0
votes
SQL sorgusu:

CREATE TABLE online(

idonline İNT( 10 ) UNSİGNED NOT NULL AUTO_INCREMENT ,
ip VARCHAR( 16 ) ,
domain VARCHAR( 100 ) ,
FKiduyeler İNT( 10 ) UNSİGNED,
lasttime TİMESTAMP DEFAULT  'CURRENT_TIMESTAMP',
PRIMARY KEY ( idonline ) ,
KEY online_index3587( ip ) ,
KEY online_index3588( domain ) ,
KEY online_index3592( FKiduyeler ) ,
KEY online_index3604( lasttime )
);

MySQL çıktısı: Belgeler

#1067 - Invalid default value for 'lasttime' 

Before everthing sorry about my english; when l upload my db ,l got this proglem.Please help me.Thanks

2
See the manual under TIMESTAMP, and then get back to us. - Strawberry
lasttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ... ditch the I with a dot above it, and remove the single quotes. - Tim Biegeleisen
thank for help but l didn't understand you .possible to show me - urnekm
For those not speaking Turkish: sorgusu = query, hata = error, çıktısı = output, belgeler = documents. - Anton Samsonov

2 Answers

1
votes
  • CURRENT_TIMESTAMP instead of 'CURRENT_TIMESTAMP'
  • I instead of İ at multiple places.

CREATE TABLE `online`(

idonline INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
ip VARCHAR( 16 ) ,
domain VARCHAR( 100 ) ,
FKiduyeler INT( 10 ) UNSIGNED,
lasttime TIMESTAMP DEFAULT  CURRENT_TIMESTAMP, -- lose the single quotes here
PRIMARY KEY ( idonline ) ,
KEY online_index3587( ip ) ,
KEY online_index3588( domain ) ,
KEY online_index3592( FKiduyeler ) ,
KEY online_index3604( lasttime )
);
0
votes

Thank for helping, but when l do that I'm getting this problem:

CREATE TABLE visitor_chats ( visitor_id varchar(32) NOT NULL, browser_id varchar(32) NOT NULL, visit_id varchar(32) NOT NULL, chat_id int(11) unsigned NOT NULL, fullname varchar(255) NOT NULL, email varchar(255) NOT NULL, company varchar(255) NOT NULL, status tinyint(1) unsigned NOT NULL, typing tinyint(1) unsigned NOT NULL, waiting tinyint(1) unsigned NOT NULL, area_code varchar(255) NOT NULL, first_active int(10) unsigned NOT NULL, last_active int(10) unsigned NOT NULL, qpenalty int(10) unsigned NOT NULL, request_operator varchar(32) NOT NULL, request_group varchar(32) NOT NULL, question varchar(255) NOT NULL, customs text NOT NULL, allocated int(11) unsigned NOT NULL, internal_active tinyint(1) unsigned NOT NULL, internal_closed tinyint(1) unsigned NOT NULL, internal_declined tinyint(1) unsigned NOT NULL, external_active tinyint(1) unsigned NOT NULL, external_close tinyint(1) unsigned NOT NULL, exit int(11) [...]

MySQL error

"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit int(11) unsigned NOT NULL,PRIMARY KEY (visitor_id,browser_id,visit_id,c' at line 26"