Something like:
REPLACE INTO vips SET active = 0, inactive = 0 WHERE ip = 3494220867 AND proto = "https";
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it works exactly like the more standard
insertsince it is, after all, adelete/insertequivalent.See here for details.
Based on your added comment:
I think you’re looking for the INSERT … ON DUPLICATE KEY UPDATE command.
This will attempt to
insertthe data and do theupdatebit if the row already exists.Now I’m not sure how well this will work unless the ip/proto is the primary key. You may need to revert to the standard method of: