Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/03/2013, 12:42
alexiel3006
 
Fecha de Ingreso: julio-2010
Mensajes: 5
Antigüedad: 13 años, 9 meses
Puntos: 0
Respuesta: como mostrar el contenido de un registro en una tablas html

lo cambie pero aun no logro que me muestre los datos
puede que haya otro error ???
<html>
<body>
<?php


$conx = mysql_connect ("localhost","root","","tatos");
if (!$conx) die ("Error al abrir la base <br/>". mysql_error());
mysql_select_db("tatos") OR die("Connection Error to Database");


$sql="select * from articulos";
$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> ARTICULOS</th>
<tr>
<th> id_articulos </th><th> descripcion </th>
<th> marca </th><th> precio </th>
</tr>";


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

?>
</body>
</html>


muchas gracias por ayudarme