note 33670 deleted from function.mysql-affected-rows by danbrown

From: Date: Tue, 28 Apr 2009 01:51:13 +0000
Subject: note 33670 deleted from function.mysql-affected-rows by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153881@lists.php.net to get a copy of this message
Note Submitter: raistlin at oracolo dot com ---- | If you need to know the actual count of rows, | even if some update changed nothing add a field | count int(11) and add | one on every update, like in: | | mysql_query("update table set count=count+1, ..."); | if (mysql_affected_rows()==0) { | mysql_query("insert into table ..."); | } Better: add a field flag tinyint(1) unsigned default '0' on every update: "update table set flag=1-flag, ..."

« previous php.notes (#153881) next »