3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // new data $id = $_POST['memids']; $truck_no = $_POST['truck_no']; $vin = $_POST['vin']; $plate = $_POST['plate']; $trk_status = $_POST['status']; // query $sql = "UPDATE truck SET truck_no=?, vin=?, plate=?, trk_status=?, user_id=? WHERE id=?"; $q = $db->prepare($sql); $q->execute(array($truck_no,$vin,$plate,$trk_status,$u->username,$id)); header("Location: truck.php"); exit; ?>
based on 1Z5V7
Output for 7.1.25 - 7.3.2
Notice: Undefined index: memids in /in/7PNQR on line 3 Notice: Undefined index: truck_no in /in/7PNQR on line 4 Notice: Undefined index: vin in /in/7PNQR on line 5 Notice: Undefined index: plate in /in/7PNQR on line 6 Notice: Undefined index: status in /in/7PNQR on line 7 Notice: Undefined variable: db in /in/7PNQR on line 12 Fatal error: Uncaught Error: Call to a member function prepare() on null in /in/7PNQR:12 Stack trace: #0 {main} thrown in /in/7PNQR on line 12
Process exited with code 255.