Re: supplied argument errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PJ wrote:

> Lex Braun wrote:
>>
>>
>> On Tue, Jun 23, 2009 at 4:10 PM, PJ <af.gourmet@xxxxxxxxxxxx
>> <mailto:af.gourmet@xxxxxxxxxxxx>> wrote:
>>
>>     I think there is something I do not understand in the manual about
>>     mysql_fetch_assoc(), mysql_affected_rows()
>>     The code works, but I get these annoying messages.
>>     snippet:
>>
>> <snip>
>> What are the warnings?
> 1 .supplied argument is not a valid MySQL result resource
> 2. supplied argument is not a valid MySQL-link resource
> 
> snippet:
> $result = mysql_query($sql, $db); // this is following an UPDATE
>           $row = mysql_fetch_assoc($result); // warning... 1.
>           if (mysql_affected_rows($result) !== -1) //warning...2.
>         print_r($result); // returns 1
> 
> another:
>  $sql = "DELETE FROM book_categories WHERE bookID = $bid";
>             $result = mysql_query($sql, $db);     // warning...1.
>               $row = mysql_fetch_assoc($result); // warning...1.
>                 if (mysql_num_rows($result) !== 0) {
> the last:
>   $result = mysql_query($sql,$db); // following an INSERT
>     if (mysql_affected_rows($result) == -1) {  // warning....2.
> 
> 
> 

Oh for $deity's sake, haven't you yet learned to a) echo your query and b)
use mysql_error() as aids to debugging errors with mysql ???



Cheers
-- 
David Robley

Imagery is All In The Mind.
Today is Setting Orange, the 29th day of Confusion in the YOLD 3175. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux