Need help with mySQL Statement error?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Need help with mySQL Statement error?
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
Hello telli.

I didnt know where to post this so I thought I would try here. I seem to have a problem with a script I am trying to make into a module however this SQL statement wont work in phpMyAdmin


This is the mySQL table

/*Begin Create Clients*/
$query = "CREATE TABLE `".DB_PREFIX."clients` (
`client_id` int(11) NOT NULL auto_increment,
`username` varchar(100) NOT NULL default '',
`password` varchar(100) NOT NULL default '',
`company` varchar(255) default NULL,
`email` varchar(255) NOT NULL default '',
`first_name` varchar(100) default '',
`last_name` varchar(100) default '',
`address` varchar(255) default NULL,
`address_2` varchar(100) default '',
`city` varchar(100) default '',
`state` varchar(100) default '',
`zip` varchar(100) default '',
`client_number` int(11) default '',
`phone_number` varchar(100) default '',
`fax_number` varchar(100) default '',
`ptax` double(10,4) NOT NULL default '0.0725',
`p2tax` double(10,4) NOT NULL default '0.1900',
`gtax` double(10,4) NOT NULL default '0.0725',
PRIMARY KEY (`client_id`),
UNIQUE KEY `username` (`username`)
) TYPE=MyISAM;";
mysql_query ($query);

However mySQL is complaining about the following line

MySQL said:

#1067 - Invalid default value for 'client_number'

If anyone could help me it would be appreciated....

xtrax



Back to top Reply with quote
#2   re: Need help with mySQL Statement error?
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Change this line from:


`client_number` int(11) default '',


To


`client_number` int(11) NOT NULL default '0',




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Need help with mySQL Statement error?
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
Thank you once again teli,

How much do you charge to make some changes to a piece of software we bought, we would need it to be compatable for php 4 & php 5, plus make it a little more automated with client accounts, such as adding a cron to check when clients should be auto sent a new invoice etc...

xtrax



Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Send me the details by PM and I will take a look and send you a quote.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum