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 )); 

see mysql pdo now() assigned value - possible?


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -