mysql_affected_rows doesn't like it's argument.
| From: | August Zajonc | Date: | Sun, 26 Mar 2000 20:38:46 +0000 |
| Subject: | mysql_affected_rows doesn't like it's argument. | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-12646@lists.php.net to get a copy of this message | ||
mysql_affected_rows has some strange behavior.
Here's a simplified sample script:
$sql = "INSERT INTO Reviews Values (NULL, '0', NOW(), '5', '5',
'5', '1',
'4', 'gbg', 'fg', 'sdfg');";
$db = mysql_pconnect($db, $us, $pw);
mysql_select_db($dbname, $db);
$result = mysql_query($sql, $db);
echo $result;
echo mysql_affected_rows($result);
This kicks back the error that $result is not a valid MySQL-Link resource.
However, changing the last line to read
mysql_affected_rows() works wonderfully. What's strange is that echo $result
always returns one. I am assuming that the nature of the query determines
whether a link resource is returned or not. Perhaps this has changed
recently?
Pointers appreciated.
August