faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

17 of 39 people (44%) answered Yes
Recently 1 of 10 people (10%) answered Yes

Entry

When using UPDATE where var = case , how can I make Mysql INSERT this row if it does not exist yet?

Feb 24th, 2008 00:21
dman, Carsten Pedersen, tony dermont, http://www.ttnr.org


You probably want to use REPLACE rather than UPDATE/INSERT. This will 
replace any existing records having the same keys as your new data.