Problems with queries
| From: | Glenn Miller | Date: | Thu, 10 Aug 2000 19:21:03 +0000 |
| Subject: | Problems with queries | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1941@lists.php.net to get a copy of this message | ||
Hello
I 've recently installed PHP 4 and MySQL v 2.32.22 , but so far have not
been able to run correctly, not even the simplest query. I have a
database
called "otra", which in turn holds a single table called "usuarios" with
only one column: "id".
When I try to run the next script:
<html>
<body>
<?php
$db = mysql_connect("isocor.cem.itesm.mx:3306","root","mandarin");
mysql_select_db("otra",$db);
$result = mysql_query("SELECT * FROM usuarios;",$db);
printf("First Name: %d<br>\n", mysql_result($result,0,"id"));
?>
</body>
</html>
All I get is the next message:
Warning: Supplied argument is not a valid MySQL result resource in
/export/home2/homepage/docs/otra.php4 on
line 8
First Name: 0
I'm sure the connection functions, but cannot make any queries...
Any ideas will be appreciated...