Hmm, it looks like your SQL statement does not require single quotes. For example, you can try running this block:
$STH = $DBH->prepare("UPDATE b_temp_booking SET check_in = :check_in, check_out = :check_out, adults = :adults, children1 = :children1, children2 = :children2, infants = :infants, cots = :cots, promo_code = :promo_code WHERE temp_booking_id = :temp_booking_id");
Check out the PHP manual in the prepared PDO reports: http://www.php.net/manual/en/pdo.prepared-statements.php It looks like quotes are not needed around named placeholders here.
Also, try running their example where they use the bindParam () method:
$STH->bindParam(':temp_booking_id', $temp_booking_id); $temp_booking_id = $_SESSION['temp_id']; // Not sure how binding the environment variable will work, so decoupling it. $STH->bindParam(':check_in', $in); $STH->bindParam(':check_out', $out); $STH->bindParam(':adults', $a); $STH->bindParam(':children1', $c1); $STH->bindParam(':children2', $c2); $STH->bindParam(':infants', $i); $STH->bindParam(':cots', $c); $STH->bindParam(':promo_code', $pc);
When you are ready to run, you can run the following line:
$STH->execute();
Check this out and see if the parameter you are looking for is optional.
source share