<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:PHPLinks -> DewNewLinks ? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:PHPLinks -> DewNewLinks ?
#1416
Dewed (Admin)
Admin
Posts: 606
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:PHPLinks -> DewNewLinks ? 1 Year, 9 Months ago Karma: 9  
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');
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
      Topics Author Date
    thread link
PHPLinks -> DewNewLinks ?
seedy 2010/07/26 20:17
    thread link
thread linkthread link Re:PHPLinks -> DewNewLinks ?
Dewed 2010/07/27 08:56
    thread link
thread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/27 09:09
    thread link
thread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
Dewed 2010/07/27 09:38
    thread link
thread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/27 09:40
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/28 21:28
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/28 22:45
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
Dewed 2010/07/29 00:25
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/29 01:36
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
Dewed 2010/07/29 09:48
    thread link
thread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread linkthread link Re:PHPLinks -> DewNewLinks ?
seedy 2010/07/29 10:08
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008