Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/07/2013, 08:06
jegggf
 
Fecha de Ingreso: septiembre-2012
Ubicación: montevideo
Mensajes: 131
Antigüedad: 11 años, 7 meses
Puntos: 0
error en codigo simple

function tabla ($result)
{
global $db_selected;
global $db;

$sql="select * from prueba2";
$result= mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result)==0) die("No hay registros para mostrar");

echo "<table border=1 cellpadding=4 cellspacing=0>";

echo "<tr>
<th colspan=5> objetos </th>
<tr>
<th> lugar </th>
<th> capacidad </th>
</tr>"

while($row=mysql_fetch_array($result))
{
echo "<tr>
<td align='right'> $row[lugar] </td>
<td> $row[capacidad] </td>;
</tr>";
}
echo "</table>";
}

?>

me da un error en el while, no me doy cuenta porque. la tabla se llama prueba2 com dos columnas, lugar y capacidad, gracias