Hey guys, i'm having an issue inserting "now()" into a mysql table.
I'm setting my variables up in an associative array like so:
$new_app = array(
'un_read'=>U,
'first_name'=>$first_name,
'last_name'=>$last_name,
'ip_addr'=>$ip_addr,
'floodtime'=>now()
);
Then to add the info to the db, I use a db abstraction layer written by Matt Zandstra - outlined in Sams Teach Yourself PHP in 24 hours
# skipping abstraction layer code and going right to the insertion
$add_app2db = $dl->insert( "creditapps", $new_app );
/* translates to "INSERT INTO creditapps(un_read, first_name, last_name, ip_addr, floodtime)
VALUES('".$_POST['un_read']."','".$_POST['first_name']."','".$_POST['last_name']."', '$ip_addr', now())";
*/
This is not the exact code, but it gives the general idea as to whats happening. However, I get an error when I try to insert "now()". It tells me that there is a call to an undefined function now().
If I use the latter code, it works so it's not how php was compiled causing this issue. It's when I use the db abstraction layer that I end up with an issue, but I thought now() was a mysql function and would be recognized?
Can now() not be defined in an array for db insertion?