PHP 4.0 Bug #6666: mySQL result

From: Date: Tue, 12 Sep 2000 05:40:51 +0000
Subject: PHP 4.0 Bug #6666: mySQL result
Groups: php.dev 
Request: Send a blank email to php-dev+get-32938@lists.php.net to get a copy of this message
From: ldcosta@tutopia.com Operating system: Linux PHP version: 4.0.2 PHP Bug Type: MySQL related Bug description: mySQL result Hi, I'm form Argentina, and I've done the configuration of PHP4 --with-mysql, --with-apxs and --enable-ftp. Now, i'm trying to work with mysql and i can't, it says that it has an error. Here's the code: <html> <body> <? /*$conex = mysql_connect("localhost", "nobody"); mysql_select_db("hardsite", $conex); $resultado = mysql_query("SELECT * FROM hardsite", $conex); echo "Vendedor: ".mysql_result($resultado, 0, "vendedor")."<BR>"; echo "e-mail: ".mysql_result($resultado, 0, "mail")."<BR>"; echo "Producto: ".mysql_result($resultado, 0, "producto")."<BR>"; echo "Precio: ".mysql_result($resultado, 0, "precio")."<BR>"; echo "Tipo de pago: ".mysql_result($resultado, 0, "pago")."<BR>"; echo "Descripción: ".mysql_result($resultado, 0, "descripcion")."<BR>"; */ $link = mysql_connect("localhost", "nobody"); mysql_select_db("hardsite", $link); $result = mysql_query("SELECT * FROM ventas", $link); echo "Nombre: ".mysql_result($result, 0, "vendedor")."<br>"; echo "Dirección: ".mysql_result($result, 0, "mail")."<br>"; ?> </body> </html> And here the result of the page Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/miprimeradb.php on line 17 Nombre: Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/miprimeradb.php on line 18 Dirección: ----------------------------- I know that i'have commented the first part, but it was because i was trying, and it didn't work. But the second part was part of an example that i've downloaded of the net, i've changed the name of the database and the fields. Well, i hope you can help me Regards, Leandro Costa

« previous php.dev (#32938) next »