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); 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. 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? 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. 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. 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? 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 ? 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. 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? 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 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
Archived
This topic is now archived and is closed to further replies.