| 
 Posted by Charles Polisher on 01/02/08 01:22 
>>> Aaron Gray wrote: 
> I have a MySQL table of pages each with a 'title' and 'page' fields. 
> 
> How do I do either an UPDATE if the pages 'title' exists or an INSERT   
> if 
> it 
> does not ? 
 
Check out the REPLACE syntax: 
http://dev.mysql.com/doc/refman/5.0/en/replace.html 
 
Your code looks okay ... what does print_r($title) 
show? Where's the BEGIN for the transaction?
 
[Back to original message] 
 |