![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/07/2012, 06:56
|
| | Fecha de Ingreso: junio-2012 Ubicación: maracaibo
Mensajes: 36
Antigüedad: 12 años, 7 meses Puntos: 0 | |
Respuesta: hacer una consulta a 3 tablas holaaa, necesto me des una ayudita aqui, por favor.
este es mi codigo.
$consultar = "SELECT u.username, u.idnumber, c.id, c.fullname, cm.name FROM (mdl_user u INNER JOIN mdl_course c ON u.id=c.id) INNER JOIN mdl_course_categories cm ON c.id =cm.id WHERE u.idnumber='$cedula'";
$query = mysql_query($consultar) or die(mysql_error());
$total_reg = mysql_num_rows($query );
if($total_reg >0){
?>
<table width="358" height="59" border="1">
<tr>
<th scope="col">Cedula </th>
<th scope="col">Categoria </th>
<th scope="col">Nombre del Profesor </th>
<th scope="col">Curso </th>
<th scope="col">Curso nombre </th>
</tr>
<?php
while($result=mysql_fetch_array($query )){
?>
<tr>
<td><?php echo $result['u.username'] ?> </td>
<td><?php echo $result['u.idnumber'] ?> </td>
<td><?php echo $result['c.id'] ?> </td>
<td><?php echo $result['c.fullname'] ?> </td>
<td><?php echo $result['cm.name'] ?> </td>
</tr>
<?php
el problema es que no me muetsra los datos en la tablas... si ven algun error diganme xfa.. |