RE: [PHP-DB] Datetime help in an INSERT...

From: Date: Thu, 05 Jun 2003 13:57:19 +0000
Subject: RE: [PHP-DB] Datetime help in an INSERT...
Groups: php.db 
Request: Send a blank email to php-db+get-28348@lists.php.net to get a copy of this message
I have actually discovered that the $td value is blank. The reason appears to be that the page is reloading when a button is pushed, and that is when the $td value is being lost. My question now is, how do I keep the $td value after the page is reloaded? I would rather keep the value from the original query than perform another database query to populate this value yet again. Thanks yet again for the help. -----Original Message----- From: CPT John W. Holmes [mailto:holmes072000@charter.net] Sent: Wednesday, June 04, 2003 2:14 PM To: NIPP, SCOTT V (SBCSI); jay@advmed.com Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Datetime help in an INSERT... > > I am stumbling across something that I thought I have done before, > > and I am not having any luck finding an example of this. Basically, I am > > wanting to timestamp the date and time into new entries in a simple > database > > table. The following section is the actual code for this, and I cannot > > figure out how to get the date/time stamp to populate into the database. > > Thanks in advance for the help. I suspect this is a very simple fix. > > > > $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td, > NOW())"; > > $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error()); > > The error I am receiving is: > > You have an error in your SQL syntax near ' NOW())' at line 1 Are you sure $td has a value? If it's blank, you'd get an error like that. ---John Holmes...

« previous php.db (#28348) next »