Hi,

This is more a question of how to use php, so perhaps this page may be
of more use http://us2.php.net/manual/en/function.mysql-query.php 

It gives a good explanation there of how the SELECT statement will
return the resource number on success, if you wish to access the data
returned, you need to use one of several other functions eg.
mysql_fetch_array etc. In other words, your query worked fine, you just
haven't accessed the data returned yet.

http://www.php.net is a valuable resource on how to use this fine
language.

Regards 


---------------------------------------------------------------
********** _/     **********  David Logan 
*******   _/         *******  ITO Delivery Specialist - Database
*****    _/            *****  Hewlett-Packard Australia Ltd
****    _/_/_/  _/_/_/  ****  E-Mail: [EMAIL PROTECTED]
****   _/  _/  _/  _/   ****  Desk:   +618 8408 4273
****  _/  _/  _/_/_/    ****  Mobile: 0417 268 665
*****        _/       ******    
******      _/      ********  Postal: 148 Frome Street,
********   _/     **********          Adelaide SA 5001
                                      Australia 
i    n    v    e    n    t                                   
---------------------------------------------------------------

-----Original Message-----
From: Pat Adams [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 12 March 2006 4:45 PM
To: Mysql
Subject: Re: mysql_query gives Resource id #3 error

On Sat, 2006-03-11 at 12:53 -0500, fbsd_user wrote:
>       $sql = "SELECT logon_id
>               FROM members
>               WHERE logon_id = '$logonid' AND logon_pw =
> '$logonpw'";
> 
>       $result = mysql_query($sql) or die('Query failed. ' .
> mysql_error());
> 
>       print "$result";  shows Resource id #3
> 
>   Where can I find meaning for what this means?
> 
>   And why does mysql_error() not contain the description of this
> error?
> 
>   And why was the 'or die' condition not taken?

Try print($result[0]) or print($result['logon_id']); $result is a handle
to the result set, not something you can print. It's the same thing as
if you tried to print out the return value of mysql_connect, which
should return a resource id. There wasn't an error with the query, so
the or die shouldn't execute, and mysql_error should return null.

-- 
Pat Adams
Digital Darkness Promotions
Check out the Dallas Music Wiki http://digitaldarkness.com/tiki

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to