Reply
New with programming - MySQL error
Old 04-13-2008, 11:03 PM New with programming - MySQL error
Ultra Talker

Posts: 330
http://sourceforge.net/projects/wtfo/

I am trying to install this script on my server, but when I try to import the MySQL tables file in PHPmyadmin I get this error:

Error

SQL query:

#
# Table structure for table 'comments'
#
CREATE TABLE comments(
id int( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
user tinyint( 4 ) DEFAULT '0' NOT NULL ,
record date DEFAULT '0000-00-00' NOT NULL ,
comments text,
PRIMARY KEY ( id ) ,
KEY user( user, record )
);

MySQL said: Documentation
#1067 - Invalid default value for 'id'


Obviously the script is pretty old, but is the only of it's kind that I can find.

How can I fix this problem?

Thanks guys - your help is always appreciated!
__________________
UptimeKing - 99.9% uptime web hosting. Set up an account within minutes.
JGiannotti is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-14-2008, 08:33 AM Re: New with programming - MySQL error
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
I think if its auto_increment then there shouldn't be a default value. I'm not sure though
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-14-2008, 08:35 AM Re: New with programming - MySQL error
GeorgeB's Avatar
I Love Lamp

Posts: 990
Quote:
Originally Posted by Gilligan View Post
I think if its auto_increment then there shouldn't be a default value. I'm not sure though
That's precisely right
__________________
Consumer Reviews Forum <-- Need Forum Posters, PM ME PLEASE!
Get Free HD Wallpapers Oh snap! Free Coupons Deals & Bargains @ CoolWebOffer.com!
GeorgeB is offline
Reply With Quote
View Public Profile Visit GeorgeB's homepage!
 
Old 04-14-2008, 08:54 AM Re: New with programming - MySQL error
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
sweet My PHP and MySQL programming skills are increasing
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-14-2008, 01:25 PM Re: New with programming - MySQL error
Ultra Talker

Posts: 330
Awesome! Thanks for the info guys.

So should I just remove DEFAULT '0' from the sql file?
__________________
UptimeKing - 99.9% uptime web hosting. Set up an account within minutes.
JGiannotti is offline
Reply With Quote
View Public Profile
 
Old 04-14-2008, 02:53 PM Re: New with programming - MySQL error
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
only for the id column.

Code:
 id int( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
replace that with this:

Code:
 id int( 11 ) NOT NULL AUTO_INCREMENT ,
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-15-2008, 11:02 PM Re: New with programming - MySQL error
Ultra Talker

Posts: 330
Wow, thanks a bunch guys! Works great! Now I just have to install the graph system. http://www.aditus.nu/jpgraph/index.php is the graph system I'm using. For some reason nothing is being displayed on the graph page. I need a little more assistance. http://www.tampabodybuilding.net/log...eight&type=bar is just showing an image cannot be displayed square.

I may have the source written incorrectly on the config page:
$jpgraph_path = "/user/public_html/logs/src/";

It is all uploaded to my /logs/src/ directory though
__________________
UptimeKing - 99.9% uptime web hosting. Set up an account within minutes.
JGiannotti is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to New with programming - MySQL error
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14878 seconds with 13 queries