473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Adding up DATETIME field

Hi,

i'm struggling with updating session expire times in my login table.

Can you tell me, how to correctly add an amount of seconds (after that
the session expires) to a datetime field?

when i do the insert for a new login, or an update, the expire field
will alway end up containing zeros

below are my statements and structure, (MySQL version: 4.0.13)
Thanks for any help

Maik

INSERT INTO `user_login` (
`id_kontakt`,
`id_user`,
`session`,
`expire`,
`ip`,
`browser`,
`id_sprache`,
`username`)
VALUES (
25,
39,
'1061461259142493',
(NOW()+SEC_TO_TIME(6000)),
'192.168.0.3',
'Opera/7.11 (Windows NT 5.0; U) [de]',
1,
'maik'
);
UPDATE `user_login` SET `expire` = (NOW()+SEC_TO_TIME(6000))
WHERE `session` LIKE '1061461259142493';
CREATE TABLE `lok_user_login` (
`lfdnr` bigint(20) unsigned NOT NULL auto_increment,
`id_kontakt` bigint(20) unsigned NOT NULL default '0',
`id_user` bigint(20) unsigned NOT NULL default '0',
`username` varchar(255) NOT NULL default '',
`session` varchar(255) NOT NULL default '',
`expire` datetime NOT NULL default '0000-00-00 00:00:00',
`ip` varchar(15) NOT NULL default '',
`browser` varchar(255) NOT NULL default '',
`id_sprache` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`lfdnr`),
UNIQUE KEY `session` (`session`),
FULLTEXT KEY `session2` (`session`)
) TYPE=MyISAM;


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1229

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: M. Bader | last post by:
Hi, i'm struggling with updating session expire times in my login table. Can you tell me, how to correctly add an amount of seconds (after that the session expires) to a datetime field? ...
6
by: Carl | last post by:
Hi, to be use with SQL server database 1- From window form textbox object From this assignement, txtTOTAL.Text="0.00m"; How do you convert back to decimal type ? How do you assign a...
44
by: Frank Rizzo | last post by:
Any ideas?
6
by: FatboyCanteen | last post by:
When I using dataset to append a null value to the datetime field. It throw a error -> can not convert db.null to system.date Can there is any standard to pass a Null value to the DateTime...
1
by: Thierry | last post by:
Hi, I've got the next problem: I have a datetime field in my database (sql-server) and I want the option in it that this field can be empty. But if I leave that datetime field empty I get...
20
by: Bryan | last post by:
hello all... im trying to add a record to an sql db on ms sql server 2000, using vb.net. seems to be working.. except for one thing, one of the columns in the database is a bit datatype, and...
1
by: RML | last post by:
Hi everyone, I am using VB.NET 2003 and an OleDBDataAdapter to update an Access table's DateTime field. The field's format is set to "General Date" (ie: 11/24/2004 8:00:00 AM). The problem is...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
4
by: Bill Gower | last post by:
Why won't this work? What do I need to do to make it work? DateTime? DateMember; if((DateTime.Parse(oldRow.ToString) == null)) DateMember = null; else DateMember =...
8
by: David | last post by:
I'm trying to add a date and time to an html form, but I'm having a bit of trouble getting it working. Any suggestions? Thanks! ~ David (merlin001_at_gmail_dot_com)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.