I have the following code:
INSERT IGNORE INTO unsubscribes (email) VALUES ([email protected]),([email protected]),([email protected]),([email protected])
but it repeatedly returns an error...
The error is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@john.com),([email protected]),([email protected]),(another' at line 1
Any ideas why? It is legal to do insert ignore with multiple values right?
Put the values inside quotes.
This will work
INSERT IGNORE INTO unsubscribes (email)
VALUES ('[email protected]'),
('[email protected]'),
('[email protected]'),
('[email protected]')
Note that varchar, text etc values should be inside the quotes.
INSERT IGNORE INTO unsubscribes (email)
VALUES ('[email protected]'),('[email protected]'),('[email protected]'),('[email protected]');
with the above query i don't find any issues. I think that you have missed quotes to enclose string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With