php - Fatal error: Call to a member function execute() on a non-object PDO Working -


error message:

fatal error: call member function execute() on non-object on line 30

lines 29 , 30

$stmt = $pdo->prepare("insert installs (customer_id, engineer_id, datetime, tracker, tracker_serial, tracker_sim, satnav, eco_plus, eco_plus_address, ttconnect, ttconnect_address, fms, remote_link, remote_link_address, remote_logbook, remote_logbook_address, registration, vehicle_make, vehicle_model, colour, mileage, box_location, comments, ip_address) values (:1,:2,:3,:4,:5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24)"); $stmt->execute(array("1" => $customer_id, "2" => $engineer_id, "3" => $date, "4" => $tracker, "5" => $tracker_serial, "6" => $tracker_sim, "7" => $satnav, "8" => $eco_plus, "9" => $eco_plus_address, "10" => $ttconnect, "11" => $ttconnect_serial, "12" => $fms, "13" => $remote_link, "14" => $remote_link_address, "15" => $remote_logbook, "16" => $remote_logbook_address, "17" => $registration, "18" => $vehicle_make, "19" => $vehicle_model, "20" => $colour, "21" => $mileage, "22" => $box_location, "23" => $comments, "24" => $ip_address)); 

i can't find issue, pdo working other queries in project, appreciated.

not sure if why throwing error, need colon in paramters array

$stmt = $pdo->prepare("insert installs (customer_id, engineer_id, datetime, tracker, tracker_serial, tracker_sim, satnav, eco_plus, eco_plus_address, ttconnect, ttconnect_address, fms, remote_link, remote_link_address, remote_logbook, remote_logbook_address, registration, vehicle_make, vehicle_model, colour, mileage, box_location, comments, ip_address) values (:1,:2,:3,:4,:5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24)"); $stmt->execute(array(":1" => $customer_id, ":2" => $engineer_id, ":3" =>...etc)); 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -