Ver Mensaje Individual
  #6 (permalink)  
Antiguo 01/11/2010, 09:41
johhan16
 
Fecha de Ingreso: junio-2010
Ubicación: Venezuela, Zulia
Mensajes: 686
Antigüedad: 13 años, 10 meses
Puntos: 55
Respuesta: Consultas php mysql listar categorias de dos tablas diferentes

bueno asi como te envie a tu bandeja realizas la conexion luego le agregas a este codigo que te puse

Código PHP:
<?php
include("cone.php"); 
$link=conectarse();

//OJO tu dices que no sabes que es eso eso es catID que se debe encontrar en la tabla faca_categories, que no entiendo el nombre, me imagino que te estas copiando de algun otro programa
$categoria=1;


$sql="Select * from faca_categories, faca_topics where faca_categories.catID = '$categoria' and faca_categories.catID = faca_topics.catID order by topicID";
$querymysql_query($sql,$link);
?>

<table width="80%" border="1" align="center">
  <tr>
    <td width="6%">Num.</td>
    <td width="7%">Topic ID</td>
    <td width="9%">Categoria ID</td>
    <td width="33%">Nombre</td>
    <td width="45%">Pregunta</td>
  </tr>
<?php 
$i
=1;
while(
$array=mysql_fetch_array($query)) {

}
?>  
  <tr>
    <td><?php echo $i?></td>
    <td><?php echo $array['topicID']; ?></td>
    <td><?php echo $array['catID']; ?></td>
    <td><?php echo $array['name']; ?></td>
    <td><?php echo $array['question']; ?></td>
  </tr>
<?php $i++; } ?>  
</table>