You are not logged in.
Pages: 1
I use Delphi 2007 , Mysql 5.6,
CREATE TABLE `t_appstaffonline` (
`App_ID` INT(11) NOT NULL AUTO_INCREMENT ,
`Staff_ID` INT(11) NULL DEFAULT NULL,
`AppName` VARCHAR(50) NULL,
`IP` VARCHAR(50) NULL DEFAULT NULL,
`Online` INT(11) NULL DEFAULT 0,
`UpdateTime` TIMESTAMP NULL',
`LastLoginTime` TIMESTAMP NULL,
`LastLogOutTime` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`App_ID`),
UNIQUE INDEX `Idx_SAP` (`Staff_ID`, `AppName`)
);
I want to set LastLoginTime to DBServer's time,
so my SQL Statement:
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine, LastLoginTime)' +
'values(?,?,?,?,?)',[1, '127.0.0.1', 'app.exe', 1, 'now()']);
but this does not work, and
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine)' +
'values(?,?,?,?)',[1, '127.0.0.1', 'app.exe', 1]);
work fine, why
Last edited by vga (2016-12-18 01:54:20)
Offline
thank you.
How can I fill the value of the field LastLoginTime with mysql server time "now()" when insert record to the table?
Last edited by vga (2016-12-18 21:53:57)
Offline
ok,
ExecuteSQL(
'insert into `t_appstaffonline`(Staff_ID, IP, AppName, OnLine, LastLoginTime)' +
'values(?,?,?,?,now())',[1, '127.0.0.1', 'app.exe', 1]);
this work fine.
Last edited by vga (2016-12-19 22:07:35)
Offline
Pages: 1