Results 1 to 4 of 4
Oct 13, 2009, 06:12 #1
IF NOT EXISTS INSERT, ELSE UPDATE -- Is it possible?
Hey, Im wondering if you can do this in SQL. I have searched google and can't find what I'm looking for to explain it to me.
Is this possible? What am I doing wrong?
Or is this something I should do through PHP with multiple queries?
Basically it's a conditional statement.
These are fake values, Im just trying to learn if it can be done
Or what about something like this:
Oct 13, 2009, 06:55 #2
- Join Date
- Jul 2002
- Toronto, Canada
- 53 Post(s)
- 2 Thread(s)
Oct 13, 2009, 07:47 #3
Thank you for reply Rudy. I am looking at the ON DUPLICATE KEY right now.
My question I suppose is,
With an AUTO_INCREMENT column named id as my PRIMARY KEY
This probably will never have a duplicate.
Is there a way to check if there is a duplicated of assign_bot and assign_user?
Oct 13, 2009, 08:35 #4
Add another unique key (assing_bot + assign_user) to the table.Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget