Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 01-08-2009, 12:12 PM error? somewhere?
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 960
Name: Darren
Location: England
Trades: 0
Hi,

I'm running a script to populate a mysql database and keep getting this error:

Invalid default value for 'log' at row 35

the lines concered are

Code:
$q1 = "DROP TABLE IF EXISTS site_log";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "CREATE TABLE site_log (
  id int(10) NOT NULL auto_increment,
  log int(10) NOT NULL default '',
  PRIMARY KEY (id))";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);

$q1 = "INSERT INTO site_log VALUES (1,1)";
mysql_query($q1) or die(mysql_error()." at row ".__LINE__);
Can anyone see whats wrong? the rest of the tables populate if I comment the above section out...?
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-08-2009, 01:01 PM Re: error? somewhere?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
it's because log is of type "int" but you passed it an empty string '' as default. Seeing how it is of type "int", you will need to give it a default number, maybe zero? You could also allow it to be NULL (instead of NOT NULL), and make the default NULL.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-08-2009, 02:14 PM Re: error? somewhere?
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
If you don't want to set a default value, just remove the default ''.
I think it isn't required.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-08-2009, 02:28 PM Re: error? somewhere?
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
We need a topic relevancy checker for recently registered users. :P
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-08-2009, 02:30 PM Re: error? somewhere?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Quote:
Originally Posted by Insensus View Post
If you don't want to set a default value, just remove the default ''.
I think it isn't required.
That's true also.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 01-08-2009, 04:09 PM Re: error? somewhere?
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 960
Name: Darren
Location: England
Trades: 0
Thanks for the advise guys - I got the database running but the script I purchased is so full of errors you wouldnt believe it!

COntacted support and they offered to install it - for MORE money than I payed for the script itself!!!

It's going to be a long night...
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to error? somewhere?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.17315 seconds with 12 queries