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

bueno estoy intentando mostrar los datos que tengo en mi base pero me tira error
me gustaría saber si me pueden ayudar
mi base se llama: tatos}la tabla es:
TABLE ARTICULOS (
ID_ARTICULOS INTEGER NOT NULL,
DESCRIPCION VARCHAR (30) ,
MARCA VARCHAR (30) ,
PRECIO FLOAT);
este es el código que estoy utilizando pero no logro que me muestre los datos
si alguien sabe porque se los agradezco
bueno acá esta

<html>
<body>
<?php


$conx = mysql_connect ("localhost","root","","tatos");
if (!$conx) die ("Error al abrir la base <br/>". mysql_error());
mysql_select_db("test") 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>


BUENO ESO ES TODO SOY NUEVO EN ESTO ESPERO QUE ME PUEDAN AYUDAR
GRACIAS