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 always wanted the adoration of John Lennon - With The Anonimity of Ringo Starr..." QuizBay Help with the testing of this Beta site!
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.
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 always wanted the adoration of John Lennon - With The Anonimity of Ringo Starr..." QuizBay Help with the testing of this Beta site!