Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/12/2006, 18:11
paulkees
 
Fecha de Ingreso: octubre-2004
Mensajes: 768
Antigüedad: 19 años, 7 meses
Puntos: 3
Hola nuevamente...

Prueba así a ver que pasa...

Código HTML:
<HTML>
<BODY>
<table style="margin-top:6px" width="100%">
<?php

function Conectarse()
{
   if (!($link=mysql_connect("localhost","usuario","contraseña")))
   {
      echo "Error conectando a la base de datos.";
      exit();
   }
   if (!mysql_select_db("tubasededatos",$link))
   {
      echo "Error seleccionando la base de datos.";
      exit();
   }
   return $link;
}

   $link=Conectarse();
   $result=mysql_query("select id,nombre FROM productos",$link);
?>
   <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 align=center bgcolor=dddddd>
      <tr><td colspan=2 bgcolor="#005399" align="center" style="padding-bottom:4px;"><span style="font-size:25px;font-family:times new roman;font-weight:bold;color:#ffffff;">PRODUCTOS</span></td></tr>
      <TR style="font-weight:bold;font-size:14px;background-color:#ffffff;text-align:center;"><TD>&nbsp;ID&nbsp;</TD><TD>&nbsp;NOMBRE&nbsp;</TD></TR>
<?php

   while($row = mysql_fetch_array($result)) {
      printf("<tr style='font-size:15px;'><td align=center>&nbsp;%s&nbsp;</td><td align=center>&nbsp;%s&nbsp;</td></tr>", $row["Id"],$row["Nombre"]);
   }
   mysql_free_result($result);
   mysql_close($link);
?>
</table>
</BODY>
</HTML> 
Saludos.-