RE: [PHP-ES] Iniciandome en PHP/MySQL
| From: | Maximo Monsalvo | Date: | Fri, 12 Jan 2001 15:05:17 +0000 |
| Subject: | RE: [PHP-ES] Iniciandome en PHP/MySQL | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-5750@lists.php.net to get a copy of this message | ||
Antes que me maten perdonen era un errror de tipeo en mybd
-----Mensaje original-----
De: Maximo Monsalvo [mailto:maximo.monsalvo@guspamar.com.ar]
Enviado el: viernes 12 de enero de 2001 11:29
Para: 'lista@phpes.com'
Asunto: [PHP-ES] Iniciandome en PHP/MySQL
Hola lista estoy leyendo un tutorial de php y maysql y tratando de hacer
los ejemplos de este pero cuando hago el shiguinte
<<html>
<body>
<?php
$link = mysql_connect("localhost", "root", "");
mysql_select_db("mydb", $link);
$result = mysql_query("SELECT nombre, email FROM agenda", $link);
echo "<table border = '1'> \n";
echo "<tr> \n";
echo "<td><b>Nombre</b></td> \n";
echo "<td><b>E-Mail</b></td> \n";
echo "</tr> \n";
while ($row = mysql_fetch_row($result)){
echo "<tr> \n";
echo "<td>$row[0]</td> \n";
echo "<td>$row[1]</td> \n";
echo "</tr> \n";
}
echo "</table> \n";
?>
</body>
</html>
me da el siguiente error "Warning: 0 is not a MySQL result index in
/home/httpd/html/max/conbordes.php3 on line 12"
Estos son los datos de la base mydb
Nombre de campo Tipo Permitir nulos? Valor por defecto Clave
Extras
id int(11) No 0 Indizada
auto_increment
nombre char(50) Sí NULL Ninguna
telefono char(15 )Sí NULL
Ninguna
email char(30) Sí NULL
Ninguna
Existen tres datos nomas con id 1,2, 3
Entiedo que por ahi el algo obio
Gracias
---------------------------------------------------------------------
Archivo On-line: http://www.phpes.com/
Manual PHP en español: http://www.php.net/manual/es/
Para dar de baja la suscripción, mande un mensaje a:
lista-unsubscribe@phpes.com