note 30734 deleted from function.mysql-query by didou
| From: | didou@php.net | Date: | Sat, 16 Aug 2003 09:25:25 +0000 |
| Subject: | note 30734 deleted from function.mysql-query by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54299@lists.php.net to get a copy of this message | ||
Note Submitter: i5ao at hotmail
----
regarding INSERT/UPDATE optimization comment at "05-Apr-2002 11:39"...
just use REPLACE instead of SELECT, if/then INSERT or UPDATE, if the SELECT is on a primary key.
The number of affected rows will be 1 if the dated was INSERTED, or 2 if UPDATED.
Easier, and probably faster.
:)