I'm using PHP with mysqli and in this example I'm trying to update the price if the username
and lastname
exists in the database, else I want to insert a new user. Why is this not working?
IF (SELECT name,lastname FROM peoplePrice WHERE name='gus' AND lastname='lw') THEN
UPDATE peoplePrice SET price='20' WHERE name='gus' AND lastname='lw';
ELSE
INSERT INTO peoplePrice (name,lastname,price)
VALUES ('nisse','johansson','20');
END IF;