note 89595 added to function.mysql-affected-rows
| From: | not at this dot com | Date: | Sun, 15 Mar 2009 21:34:40 +0000 |
| Subject: | note 89595 added to function.mysql-affected-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151979@lists.php.net to get a copy of this message | ||
dantebbs at tebbs dot org - you have made a common error in your post.
mysql_affected_rows() expects a link_identifier and not a query result resource.
you should pass the identifier aquired from mysql_connect() rather and the resource gained from
mysql_query()
<?php
$dbc = mysql_connect (localhost, mydb, mypass);
mysql_query("DELETE * FROM mydb.mytable WHERE 1");
echo mysql_affected_rows($dbc);
?>
----
Server IP: 92.48.74.199
Probable Submitter: 86.27.217.29
----
Manual Page -- http://www.php.net/manual/en/function.mysql-affected-rows.php
Edit -- https://master.php.net/note/edit/89595
Del: integrated -- https://master.php.net/note/delete/89595/integrated
Del: useless -- https://master.php.net/note/delete/89595/useless
Del: bad code -- https://master.php.net/note/delete/89595/bad+code
Del: spam -- https://master.php.net/note/delete/89595/spam
Del: non-english -- https://master.php.net/note/delete/89595/non-english
Del: in docs -- https://master.php.net/note/delete/89595/in+docs
Del: other reasons-- https://master.php.net/note/delete/89595
Reject -- https://master.php.net/note/reject/89595
Search -- https://master.php.net/manage/user-notes.php