RE: [PHP-DB] strange error
| From: | Sanders, Nicholas | Date: | Tue, 22 Aug 2000 16:13:45 +0000 |
| Subject: | RE: [PHP-DB] strange error | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2265@lists.php.net to get a copy of this message | ||
Try
> $db = mysql_connect("xxxxx","root","xxxxxx")
or die ("$PHP_SELF at line ".__LINE__."<br>".mysql_errno()." :
".mysql_error());
mysql_select_db("db_prueba",$db)
or die ("$PHP_SELF at line ".__LINE__."<br>".mysql_errno()." :
".mysql_error());
$result = mysql_query("SELECT * FROM usuarios",$db)
or die ("$PHP_SELF at line ".__LINE__."<br>".mysql_errno()." :
".mysql_error());
Then you will know what the errror is.
Nick
> ----------
> From: Glenn Miller[SMTP:gmiller@campus.cem.itesm.mx]
> Sent: 22 August 2000 17:03
> To: lista
> Subject: [PHP-DB] strange error
>
> Hi everybody .
>
> I've posted this message before, but then I had some trouble with my
> computer and lost my mails before I could read all of your replies, so
> I'm posting it again...
>
> Thanks .
>
> ---------------------------------------------
> Problem is as follows. I'm trying to execute a simple query from my
> MySQL database, but everytime y try to read a register, it keeps on
> printing the same error message.
>
> The database access permissions work just fine, as well as the
> connection.
>
> ---This is the php archive
>
> <html>
> <body>
> <?php
>
>
> $db = mysql_connect("xxxxx","root","xxxxxx");
> mysql_select_db("db_prueba",$db);
> $result = mysql_query("SELECT * FROM usuarios",$db);
> printf("Login: %s<br>\n", mysql_result($result,0,"login"));
>
> ?>
> </body>
> </html>
>
>
>
> ---This is what I receive
>
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /export/home2/homepage/docs/prueba_db.php4 on line 8
> First Name:
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>