<?
$host ="127.0.0.1";
$usuario = "root";
$password = "";
$conectar = mysql_connect ($host, $usuario, $password);
mysql_select_db ("prueba",$conectar);
$consulta = "Select numart, descripcion,precio from articulo";
$datos = mysql_query ($consulta, $conectar);
echo("<table border= 3 >");
echo ("<tr> <td> Codigo </td> <td> Descripcion </td> <td> Precio </td> </tr>");
while ($registro = mysql_fetch_row ($datos) )
{
echo "<tr> ";
foreach ($registro as $cambia)
{
echo "<td> $cambia </td>";
}
}
echo ("</table>");
?>
pero me manda estos errores:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (10061) in C:\xampp\htdocs\pAG1.PHP on line 5
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\pAG1.PHP on line 6
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\pAG1.PHP on line 8
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\pAG1.PHP on line 12