Results 1 to 4 of 4
Oct 13, 2009, 05: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, 05:55 #2
- Join Date
- Jul 2002
- Toronto, Canada
- 63 Post(s)
- 3 Thread(s)
Oct 13, 2009, 06: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, 07: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