I think this is the real problem. Basically, the $td variable is defined intially, but upon clicking a button the page reloads itself and I believe that at this time it is losing the $td variable. I am not quite sure how to prevent this from occurring. Thanks again for all the help so far. -----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: 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... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php