RE: [PHP-DB] 'replace' with 'where'
| From: | Craig Vincent | Date: | Fri, 10 Aug 2001 04:14:07 +0000 |
| Subject: | RE: [PHP-DB] 'replace' with 'where' | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11207@lists.php.net to get a copy of this message | ||
<snip>
> $result_insert = mysql_query("replace into wantlist where id =
> '$id' values ('', '$artist', '$title',
> '$tracks', '', '', '')");
> the $id is already defined in the url, by the way (ex.
<snip>
The way replace works is it looks for a unique index key in your update
list, if it finds one it uses that key to determine where the REPLACE is
done.
The update command would probably work better for you if all you're wanting
to do is change column values of a record already stored in the table. It's
also much easier and versatile
Sincerely,
Craig Vincent