Sql problem... Sql problem...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Sql problem...

Started by Ricky, November 28, 2004, 03:55:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ricky

Hi!

I made a backup of my coppermine database because i formatted my hd and when i try to reinstall the DB with phpmyadmin, i receive this error:


SQL-query:

CREATE TABLE `cpg132_pictures` (
`pid` int( 11 ) NOT NULL AUTO_INCREMENT ,
`aid` int( 11 ) NOT NULL default '0',
`filepath` varchar( 255 ) NOT NULL default '',
`filename` varchar( 255 ) NOT NULL default '',
`filesize` int( 11 ) NOT NULL default '0',
`total_filesize` int( 11 ) NOT NULL default '0',
`pwidth` smallint( 6 ) NOT NULL default '0',
`pheight` smallint( 6 ) NOT NULL default '0',
`hits` int( 10 ) NOT NULL default '0',
`mtime` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`ctime` int( 11 ) NOT NULL default '0',
`owner_id` int( 11 ) NOT NULL default '0',
`owner_name` varchar( 40 ) NOT NULL default '',
`pic_rating` int( 11 ) NOT NULL default '0',
`votes` int( 11 ) NOT NULL default '0',
`title` varchar( 255 ) NOT NULL default '',
`caption` text NOT NULL ,
`keywords` varchar( 255 ) NOT NULL default '',
`approved` enum( 'YES', 'NO' ) NOT NULL default 'NO',
`user1` varchar( 255 ) NOT NULL default '',
`user2` varchar( 255 ) NOT NULL default '',
`user3` varchar( 255 ) NOT NULL default '',
`user4` varchar( 255 ) NOT NULL default '',
`url_prefix` tinyint( 4 ) NOT NULL default '0',
`randpos` int( 11 ) NOT NULL default '0',
`pic_raw_ip` tinytext,
`pic_hdr_ip` tinytext,
PRIMARY KEY ( `pid` ) ,
KEY `owner_id` ( `owner_id` ) ,
KEY `pic_hits` ( `hits` ) ,
KEY `pic_rate` ( `pic_rating` ) ,
KEY `aid_approved` ( `aid` , `approved` ) ,
KEY `randpos` ( `randpos` ) ,
KEY `pic_aid` ( `aid` ) ,
FULLTEXT KEY `search` ( `title` , `caption` , `keywords` , `filename` )
) TYPE = MYISAM

MySQL said: Documentation
#1064 - You have an error in your SQL syntax near 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `ctime` int(11) NOT NULL defaul' at line 11



Anyone know what's wrong? I'm running MySql 3.23 with PHP 4.3 ( I was running this version on the older system)


Thanks!

kegobeer

Try replacing the line in question with this:

mtime timestamp(14) NOT NULL,
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Ricky