473,569 Members | 3,040 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,
'10614612591424 93',
(NOW()+SEC_TO_T IME(6000)),
'192.168.0.3',
'Opera/7.11 (Windows NT 5.0; U) [de]',
1,
'maik'
);
UPDATE `user_login` SET `expire` = (NOW()+SEC_TO_T IME(6000))
WHERE `session` LIKE '10614612591424 93';
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 1474

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

Similar topics

0
1239
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? when i do the insert for a new login, or an update, the expire field will alway end up containing zeros
6
1806
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 default datetime value to it ? How do you convert back the text enter by user into datetime ?
44
16923
by: Frank Rizzo | last post by:
Any ideas?
6
16248
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 Field! (It is successful to pass the Null Value to other type of Field)
1
1977
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 the error: "The value you entered is not consistent with the data type or length of the column."
20
2122
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 though i get no syntax errors when compiling, i get an error indicated that the data would be truncated. the field is login_status. ive tried in...
5
2587
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 (MSSQL Server) it worked on my test machine. If I run the same application on another machine with different regional settings is not working. I...
4
10689
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 = DateTime.Parse(oldRow.ToString()); The program is failing on the if saying that the null value in the field in
8
35966
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
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.