• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4701
  • Last Modified:

#1064 - You have an error in your SQL syntax

Hi,

I have read all previous post relating to this, but I am still unable to get my head around the problem and need a little hand holding.

I exported a db before having a server turned off. On a new server I am now trying to import the db via phpMyAdmin.

Unfortunately I do not have access to the old derver to make another backup in a compatible mode.

Here is the error I am getting, is all lost?

Thanks,

Luv2.


Error

SQL-query :  

CREATE TABLE `PLD_CATEGORY` (

`ID` int( 11 ) NOT NULL AUTO_INCREMENT ,
`TITLE` varchar( 100 ) NOT NULL default '',
`TITLE_URL` varchar( 100 ) default NULL ,
`DESCRIPTION` varchar( 255 ) default NULL ,
`PARENT_ID` int( 11 ) NOT NULL default '0',
`STATUS` int( 11 ) NOT NULL default '1',
`DATE_ADDED` timestamp NOT NULL defaultCURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`HITS` int( 11 ) NOT NULL default '0',
`SYMBOLIC` int( 11 ) NOT NULL default '0',
`SYMBOLIC_ID` int( 11 ) NOT NULL default '0',
`newsFile` varchar( 5 ) NOT NULL default '',
PRIMARY KEY ( `ID` ) ,
KEY `PLD_CATEGORY_TITLE_IDX` ( `TITLE` ) ,
KEY `PLD_CATEGORY_TITLE_URL_IDX` ( `TITLE_URL` ) ,
KEY `PLD_CATEGORY_DESCRIPTION_IDX` ( `DESCRIPTION` ) ,
KEY `PLD_CATEGORY_PARENT_ID_IDX` ( `PARENT_ID` ) ,
KEY `PLD_CATEGORY_STATUS_IDX` ( `STATUS` ) ,
KEY `PLD_CATEGORY_HITS_IDX` ( `HITS` )
)ENGINE = MYISAM AUTO_INCREMENT =193DEFAULT CHARSET = latin1

MySQL said:


#1064 - You have an error in your SQL syntax near 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `HITS` int(11) NOT NULL default' at line 8




0
Luv2Muff
Asked:
Luv2Muff
  • 4
  • 2
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what version of MySQL are you running. this error looks like you have a version that is older to when the syntax CURRENT_TIMESTAMP is supported
0
 
snoyes_jwCommented:
It also looks like you're missing a space between 'default' and 'CURRENT_TIMESTAMP'
0
 
Luv2MuffAuthor Commented:
How do I insert the missing space?

I am completely new at this I copied all the SQL into an SQL window, added the space, but still get the same error :-(

Thanks,

Luv2
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Luv2MuffAuthor Commented:
Oh hell, it did not look like that when I submitted, just had 300 lines of code. Will write to support to seee if they can remove the above.
0
 
Luv2MuffAuthor Commented:
New server is running:

MySQL 3.23.58
0
 
snoyes_jwCommented:
3.23 is really old.  It's time to upgrade.
0
 
Luv2MuffAuthor Commented:
Apologies for the late response. I have divided the points as that seemed fair. The correct answer was to upgrade. Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now