struggling with this update in PDO, i have hacked away at it in frustration, but i cannot see my error

$sql ="UPDATE late  SET late = :late,
            late_low = :late_low,
            late_high = :late_high, 
            late_peak = :late_peak, 
            over_14 = :over_14, 
            over_14_low = :over_14_low, 
            over_14_high = :over_14_high, 
            over_14_Peak = :over_14_Peak, 
            over_30 = :over_30, 
            over_30_low = :over_30_low, 
            over_30_high = :over_30_high, 
            over_14_Peak = :over_14_Peak, 
            tax = :tax  
             WHERE title =:title";

 $stmt = $dbh->prepare($sql);

$stmt->bindValue(':title', $_POST['title']);                                 
$stmt->bindValue(':late', $_POST['late']);      
$stmt->bindValue(':late_low', $_POST['late_low']);   
$stmt->bindValue(':late_high', $_POST['late_high']);
$stmt->bindValue(':late_peak', $_POST[' late_peak']);


$stmt->bindValue(':over_14', $_POST['over_14']);  
$stmt->bindValue(':over_14_low', $_POST['over_14_low']);
$stmt->bindValue(':over_14_high', $_POST['over_14_high']);
$stmt->bindValue(':over_14_Peak', $_POST['over_14_Peak']); 


$stmt->bindValue(': over_30', $_POST['over_30']);
$stmt->bindValue(':over_30_low', $_POST['over_30_low']);
$stmt->bindValue(':over_30_high ', $_POST['over_30_high']);
$stmt->bindValue(':over_14_Peak ', $_POST['over_14_Peak']); 
$stmt->bindValue(':tax', $_POST['tax']);
$stmt->execute(); 

 if ($stmt)
{
echo '<p>Rows updated: ' . $stmt->rowCount() . '</p>';
}
else
{
echo '<p>Update failed</p>';
}

oh no!! i do hope so

well it was an error but still not updating, im pretty noobiw with PDO but i thought this was not so difficult. It definitely connects, the values have been passed , so im guessing the error is in the update code or bind value code. i just cant see it and ive been looking at it way to long mow :)

$stmt->bindValue(':over_14', $_POST['over_14']);

try this instead

$stmt->bindValue('over_14', $_POST['over_14']);
commented: Totally missed it. No idea why this was downvoted. +14

@pritaeas you mean try and catch? i did that already but tried again and got naff all returned. im thinkingh of repacing this update with a standard procedule update to try and pin it down. Im guessing the code looks ok to you?
I also replaced the where clause with its unique id and added the PDO::PARAM_INT back which i had removed. I know this is something dumb but im getting to the spent too much time on this state.

@jstfsklh211 thanks but still the same

@pritaeas you mean try and catch? i did that already but tried again and got naff all returned. im thinkingh of repacing this update with a standard procedule update to try and pin it down. Im guessing the code looks ok to you?
I also replaced the where clause with its unique id and added the PDO::PARAM_INT back which i had removed. I know this is something dumb but im getting to the spent too much time on this state.

@jstfsklh211 thanks but still the same

well this is embarasing. i changed to preparing an array and i caught the exeption (not sure why i didnt before ) it was a problem caused by my bad typing (again) in lines 33 and 34 i left some spaces
:over_30_high '.
thanks for your help, I was having trouble seeing this code through the red mist that was forming :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.