Here’s a pseudo-table:
Table: people
name : varchar
is_married : varchar
I have a php variable $selected_individual whose is_married status I need to update. I’m stuck after
SELECT * from people
WHERE name = '$selected_individual'
How do I update his is_married status?
This maybe related to this question but nested queries and JOIN are way to advanced for me to get my head around at this point (I’ll look into them after some much needed sleep).
edit: for example in this query,
INSERT INTO x_table(instance, user, item)
SELECT 919191, 123, 456
FROM dual
WHERE NOT EXISTS (SELECT * FROM x_table
WHERE user = 123
AND item = 456)
I can’t seem to figure where can I plug in my ‘yes’ value myself for is_married column. (or where do I put VALUES (‘yes’) in there?)
1 Answer