I have a small website and I want to store the email of my contacts in a MySQL database.
I am using PHP and MySQL. Each time I try, it gives me following error. However when I remove the @
and .
(dot) it works fine. I really need a help on this one, please tell me what mistake I am doing and it would be very helpful if the code is given.
I already used VARCHAR
only. It keeps showing up the error below:
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 '@gmail.com( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(3' at line 1
you can use vachar
datatype with 1-255
length.
And for more information if your value's length is more then 255
then use text
datatype
Use varchar and wrap the email in quotes so it can be treated as a string like so:
That's it bro.
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