Re: [PHPLIB-DEV] cvs commit From: Kristian Köhntopp (kris <email protected>)
Date: 01/24/00

"Adam N. Thompson, MCNE" wrote:
> > - $query = sprintf("replace into %s set p_valenc='%s', p_valpos='%s', p_val='%s', p_changed='%s' where p_sid='%s' and p_name='%s'",
> > + $query = sprintf("replace into %s set p_valenc='%s', p_valpos='%s', p_val='%s', p_changed='%s', p_sid='%s' and p_name='%s'",
> > $this->database_table,
> > $this->encoding_mode,
> > '000000',
>
> Firstly, the MySQL docs do not describe a REPLACE...WHERE syntax.

Please check out
http://www.mysql.com/Manual_chapter/manual_Reference.html#REPLACE

The above syntax is still buggy, though. The "and" in the corrected
statement is still wrong. The REPLACE in itself would be the
desired behaviour, as the other databases are using an INSERT/UPDATE
combo, which can be had with REPLACE in MySQL, saving another
round-trip in the database.

Kristian

-- 
Kristian Koehntopp, Knooper Weg 46, 24103 Kiel, +49 171 2231 811
"AOL ist sowas wie die AOK der Internet-Provider."
	-- Peter Berlich <peter <email protected>>

- PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>. To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in the body, not the subject, of your message.