Problems with data types

+1 Kumi Festus · July 31, 2014

I have a problem with the correct data type for zip code and state or province

mysql_query(CREATE TABLE users(
id int NOT NULL AUTO_INCREMENT,
Name varchar(255)NOT NULL,
Email text(36)NOT NULL,
Zip Code ???? NOT NULL,
City/Town ??? NOT NULL,
State ?? NOT NULL,


I tried different data types(text,char,varchar) etc but mysql said the types were wrong.
I will appreciate your advice
Thanks

Post a Reply

Replies

Oldest  Newest  Rating
+2 Eugene Botma · July 31, 2014
the problem is that you have a space and a slash in the name, try using Zip_Code instead of Zip Code, and just City instead of City/Town. then you should be able to use any datatype that you want.
+1 Kumi Festus · August 1, 2014
You are right. I should have known better
+1 Kumi Festus · August 1, 2014
Buddy, you're right. It worked like a charm
+2 Eugene Botma · August 1, 2014
No Problem. We all make mistakes, as long as you learn from them, it's all good.
  • 1

SQL & Databases

107,276 followers
About

Everything SQL and Databases related in here!

Links
Moderators
Bucky Roberts Administrator