I'm using backand.com
to make a query that attempts to create a record in a users table if the email isn't already used:
INSERT INTO users (email, firstName, lastName, password)
SELECT * FROM (SELECT '{{email}}', 'test', 'person', '{{password}}') AS tmp
WHERE NOT EXISTS (
SELECT email FROM users WHERE email = '{{email}}'
) LIMIT 1;
It validates, but when I run it with params:
email: dave@gmail.com
password: test
I get the error:
An error occurred, please try again or contact the administrator. Error details: Duplicate column name 'test'
Why is this failing? I don't get it.
Thanks.