note 33644 deleted from function.mysql-affected-rows by danbrown
| From: | danbrown@php.net | Date: | Tue, 28 Apr 2009 01:51:35 +0000 |
| Subject: | note 33644 deleted from function.mysql-affected-rows by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153882@lists.php.net to get a copy of this message | ||
Note Submitter: anthonyd at rhsonline dot net
----
My little work around for the update problem (that I ran into):
if (mysql_affected_rows()==0) {
$q = "select .. WHERE ...<search for what you updated>'";
if (mysql_num_rows(mysql_query($q))==0)
die("0 rows affected");
else
echo "Record Alredy Existed";
}
It is probably not the best way, as I sometimes run 2 queries for the same thing, but it gets the
job done.