xcoderx Posted March 1, 2010 Share Posted March 1, 2010 hi friends what is it that im doing wrong that im unable to create table inside the company database? create database company; use company; create table employee(first_name text(30), last_name text(30), address text(500), phone int(13), designation text(50); Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/ Share on other sites More sharing options...
Mchl Posted March 1, 2010 Share Posted March 1, 2010 Count parentheses. Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019840 Share on other sites More sharing options...
xcoderx Posted March 1, 2010 Author Share Posted March 1, 2010 erm dd i miss the parenthesis at the end? Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019846 Share on other sites More sharing options...
xcoderx Posted March 1, 2010 Author Share Posted March 1, 2010 actually i did lol thanks. Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019848 Share on other sites More sharing options...
PFMaBiSmAd Posted March 1, 2010 Share Posted March 1, 2010 You will also find that int(13) won't work for a couple of reasons. INT(11) is the biggest normal integer and that includes a +/- sign as the 11th character. For the signed integer you are trying to make, the highest area code would be 214 and if you make it unsigned, 429 would be the highest area code you could store. Phone numbers are not actually numbers, they are formatted strings consisting of numeric digits. Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019849 Share on other sites More sharing options...
xcoderx Posted March 1, 2010 Author Share Posted March 1, 2010 what must i use then? Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019859 Share on other sites More sharing options...
xcoderx Posted March 1, 2010 Author Share Posted March 1, 2010 is char the right thing to use ? Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019866 Share on other sites More sharing options...
Mchl Posted March 1, 2010 Share Posted March 1, 2010 CHAR or VARCHAR. Phone numbers are not numbers in mathematical sense, so they should be stored as strings. Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1019872 Share on other sites More sharing options...
xcoderx Posted March 3, 2010 Author Share Posted March 3, 2010 thanls bro got it explained by my teacher today. int is something we use only when it has something to do with mathemetics right? Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1021022 Share on other sites More sharing options...
Mchl Posted March 3, 2010 Share Posted March 3, 2010 When you need to store a number in mathematical sense of this word. Phone numbers, zip codes, social security numbers are not numbers in mathematical sense. They're strings composed of digits. You do not add/compare/divide them. You do not need a mean of telephone numbers or maximum of zip codes Quote Link to comment https://forums.phpfreaks.com/topic/193762-mysql-command-in-command-prompt-something-wrong/#findComment-1021062 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.