php - PDO insert record issues -
the insert statement using pdo displays following errors
fatal error: call undefined function now() in c:\xampp\htdocs\copytimeline\timeline1\insert.php
it seems now() belongs in sql statements not in array. can me fix that.
thanks
$statement = $db->prepare('insert tb ( session_id,timing) values ( :session_id,:timing)'); $statement->execute(array( ':session_id' => $session_id, ':timing'=> now() ));
the mysql function now()
can't passed variable. need include in query.
$statement = $db->prepare('insert tb (session_id, timing) values (:session_id, now())'); $statement->execute(array( ':session_id' => $session_id ));
Comments
Post a Comment