Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2015, 14:58
operacionesA
 
Fecha de Ingreso: marzo-2015
Mensajes: 6
Antigüedad: 9 años, 1 mes
Puntos: 0
Busqueda Problemas con las consultas de 2 tablas

Estas son las tablas con la información:




Este es el resultado esperado:



Pero este es el resultado que me esta dando:



El código es este:

Código PHP:
Ver original
  1. <?php
  2.     //Conexion
  3.     require ("conexion.php");
  4.     //Consulta
  5.     $query = "
  6.     SELECT mbt.id, mbt.project_id, mbt.summary, mbt.date_submitted, mbt.status, mcfst.bug_id, mcfst.field_id, mcfst.value
  7.         FROM tabla_1 mbt, tabla_2 mcfst
  8.             WHERE mbt.project_id =  mcfst.bug_id
  9.                 AND mbt.project_id = 64
  10.                 AND mbt.status < 50    
  11.                 AND mcfst.field_id = 5
  12.         ORDER BY mbt.id ASC";
  13.    
  14.     //Enviar consulta a Mysql o detectar si hay error
  15.     $queEmp = mysql_query($query, $conexion) or die(mysql_error());
  16. ;?>
  17.     <table border="1px solid black">
  18.         <tr>
  19.                 <th>Folio</th>
  20.             <th>ODT</th>
  21.                         <th>Descripción</th>
  22.                 <th>Fecha de creación</th>
  23.             <th>Folio de reportes</th>
  24.         </tr>
  25.         <?php while ($resEmp = mysql_fetch_assoc($queEmp)) { ?>
  26.         <tr>
  27.                 <td><a href="http://localhost/mantis/view.php?id=<?php echo $resEmp['id'] ; ?>"><?php echo $resEmp['id'] ; ?></a></td>
  28.                 <td><?php echo $resEmp['value']; ?></td>
  29.                         <td><?php echo $resEmp['summary']; ?></td>
  30.                         <td><?php echo $resEmp['date_submitted']; ?></td>
  31.                         <td><?php echo $resEmp['value']; ?></td>
  32.         </tr>
  33.         <?php } ?>
  34.     </table>

¿Alguna idea? Gracias!