Mysql setup for contact form
I have a contact form on my website that writes to a mysql database.
The database has been setup and is being written too correctly but I am unsure whether I have setup the field types in a correct manner.
See setup below. Is there a better way of doing so:
ID - int(11) auto-increment
name - varchar(55)
surname - varchar(55)
email - varchar(55)
phone - varchar(55)
country - varchar(55)
text - text
Help appreciated as always.
(EDIT: Contains ID auto increment fiel开发者_运维技巧d)
I bet you will need autoincrement id field. It usually comes very handy.
so, you could link to particular record with just id passed in the query string for example
You just need to make sure that nobody will input more than the space you allocated in each field, here 55. In general this should suffice though.
In addition, you could shorten the email and phone lengths.
Overall this seems adequate though
精彩评论