if statement - If exists in mysql not working -


    if exists (select * pages pages.id = 21) update `pages` set `content`='updated' (`id`='21') else insert `pages` (`subject_id`) values ('102') 

not working problem

try this

 insert `pages` (`subject_id`) values ('102')  on duplicate key update `content`='updated'   `id`='21' 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -