K, that makes a wee bit more sense, but now it's early here and I've only had a bit of coffee
Depending on your version of MySQL, NULLs and empty values can be bothersome..
In almost every table I can think of, the first column is auto incremented, so you can usually leave it blank and MySQL will assign the proper value. Also, good idea to surround values with single quotes.
First error, if I understand correctly ..
Invalid default value for 'ReviewerIP'
This error isn't from an insert to the table it's from creating the table.. DOH
Change the default value for "ReviewIP" from NULL to "127.0.0.1" , or maybe an empty pair of single quotes
| Code: |
CREATE TABLE IF NOT EXISTS `phplinks_reviews` (
`ID` smallint(5) unsigned NOT NULL auto_increment,
`SiteID` smallint(5) unsigned NOT NULL default '0',
`ReviewTitle` varchar(100) NOT NULL default '',
`Review` text NOT NULL,
`Reviewer` varchar(50) NOT NULL default '',
`ReviewerEmail` varchar(50) NOT NULL default '',
`ReviewerURL` varchar(100) NOT NULL default '',
`Rating` tinyint(2) unsigned NOT NULL default '0',
`Status` enum('New','Show','Hide') NOT NULL default 'New',
`Added` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`ReviewerIP` varchar(15) default '127.0.0.1',
PRIMARY KEY (`ID`),
KEY `Rating` (`Rating`)
);
|
| Code: |
CREATE TABLE IF NOT EXISTS `phplinks_related` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`cat_id` smallint(5) unsigned NOT NULL default '0',
`rel_id` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
);
|
Autoincremented values can usually be left blank, and again depending on your version of MySQL, single quoting the values may be required...
| Code: |
INSERT INTO `phplinks_related` VALUES (, '5', '453');
|