On 12/28/12 02:00, Michael Orlitzky wrote:
On 12/28/2012 01:44 AM, Joseph wrote:
I'm not a PHP programmer but I'll try to explain my problem.
I've create table in my php database:

DROP TABLE IF EXISTS visual_verify_code;
CREATE TABLE visual_verify_code (
   oscsid varchar(32) NOT NULL,
   code varchar(6) NOT NULL,
   dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),
   PRIMARY KEY (oscsid)
);


Looks fine.


It worked OK, after few days I backup my database and try to restore it, but it keeps 
complaining on the "dt":
ERROR 1067 (42000) at line 38009: Invalid default value for 'dt'

so the database is dropped but never restored. The backup data base contain:

create table visual_verify_code (
   oscsid varchar(32) not null ,
   code varchar(6) not null ,
   dt timestamp default 'CURRENT_TIMESTAMP' not null ,
   PRIMARY KEY (oscsid)
);


CURRENT_TIMESTAMP shouldn't be quoted. How are you backing up the database?

Your are correct, when I removed the quotes it worked.

I'm backing it up through the backup.php sript that came with osCommerce, I can 
post it but it is a long one.

--
Joseph

Reply via email to