Reputation: 73
event = [eid,pid,visibility]
3 4 4
2 3 3
if I want to change the visibility value where eid =3. How to write a mysql query for this I want to change it with specific value
is possible to change the eid, and pid at the same time?
if I want to add or subtract value. for example i want -1 for visibility when i update. what is the query for this?
thank you
Upvotes: 2
Views: 96
Reputation: 1962
I am not quite sure what values you want to put in eid and pid, but sure you can update them at the same time.
Answer to question 1:
UPDATE event SET visibility = visibility-1 WHERE eid = 3
Answer to question 2 & 3:
UPDATE event SET eid = 1, pid = 1, visibility = visibility-1 WHERE eid = 3
I hope this can give you a clear answer to what you want to achive :)
Upvotes: 1