note 16517 added to function.mysql-affected-rows
| From: | admin at setel dot com | Date: | Fri, 02 Nov 2001 16:53:43 +0000 |
| Subject: | note 16517 added to function.mysql-affected-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20305@lists.php.net to get a copy of this message | ||
When checking for failures, I have found that you can not check the results of the funtion with an
if statement as follows:
if(!(mysql_affected_rows($link))){
print error
}
This function returns a -1 on failure not a false. Apparently -1 to php is not false. To get this to
work simply
redo the if statement like this:
if((mysql_affected_rows($link)) = -1){
print error
}
--
http://www.php.net/manual/en/function.mysql-affected-rows.php
http://master.php.net/manage/user-notes.php?action=edit+16517
http://master.php.net/manage/user-notes.php?action=delete+16517
http://master.php.net/manage/user-notes.php?action=reject+16517