NYCPHP Meetup

NYPHP.org

[nycphp-talk] warning - mysql resource

Chris Snyder csnyder at chxo.com
Wed Aug 27 15:06:12 EDT 2003


Could it be that the query is not finding any records?

Peter Lehrer wrote:

>the code that is triggering the warning is:
>
>$row = mysql_fetch_array($result) or trigger_error("MySQL error nr
>".mysql_errno().": ".mysql_error());
>
>It is triggering the warning:
>"Warning: Supplied argument is not a valid MySQL result resource in
>c:\program files\apache\htdocs\books\confirm.php on line 16
>
>Notice: MySQL error nr 0: in c:\program
>files\apache\htdocs\books\confirm.php on line 16"
>
>The mysql_query function actually gives no warnings or errors. Sorry about
>the confusion.
>
>Peter Lehrer
>
>----- Original Message -----
>From: "Chris Snyder" <csnyder at chxo.com>
>To: "NYPHP Talk" <talk at lists.nyphp.org>
>Sent: Wednesday, August 27, 2003 2:38 PM
>Subject: Re: [nycphp-talk] warning - mysql resource
>
>
>  
>
>>Peter Lehrer wrote:
>>
>>    
>>
>>>I am performing 2 mysql_query statements in one program and the second
>>>doesn't return a
>>>"valid MySQL result resource."
>>>
>>>Are you suppose to reconnect to the database with each mysql query?
>>>      
>>>
>>No, you can definitely use the same db connection for as many queries as
>>you like.
>>
>>Take a look at the mysql_error() function, you could use it to see what
>>is going wrong if you don't get a result from mysql_query().
>>
>>  chris.
>>
>>_______________________________________________
>>talk mailing list
>>talk at lists.nyphp.org
>>http://lists.nyphp.org/mailman/listinfo/talk
>>
>>    
>>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>  
>




More information about the talk mailing list