Error Message:
Fatal error: Call to a member function execute() on a non-object on line 30
Lines 29 and 30
$stmt = $pdo->prepare("INSERT INTO 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 the issue, pdo is working for other queries in the project, help is much appreciated.
Not sure if this is why it is throwing that error, but you need the colon in your paramters array
$stmt = $pdo->prepare("INSERT INTO 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));