note 36240 deleted from function.mysql-affected-rows by danbrown
| From: | danbrown@php.net | Date: | Tue, 28 Apr 2009 01:51:04 +0000 |
| Subject: | note 36240 deleted from function.mysql-affected-rows by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153880@lists.php.net to get a copy of this message | ||
Note Submitter: sng2nara
----
You can use following code for choosing update or insert.
mysql_query($update_sql);
preg_match(
"/^[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]+$/",
mysql_info(),
$arr);
if( $arr[1] == 0 ) // a number of matched rows is 0
{...do insert query...}
else
{...nothing...}