View Full Version : going insane....!!!

02-17-2014, 08:30 AM
im sick of looking at this, I cant see my mistake, i hope someone can Im missing something here

$dbh = new PDO("mysql:host=$hostname;dbname=villainfo", $username, $password);

$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->bindParam(':title', $_POST['title'], PDO::PARAM_STR);
$stmt->bindParam(':late', $_POST['late'], PDO::PARAM_INT);
$stmt->bindParam(':late_low', $_POST['late_low'], PDO::PARAM_STR);
$stmt->bindParam(':late_high', $_POST['late_high'], PDO::PARAM_STR);
$stmt->bindParam(':late_peak', $_POST[' late_peak'], PDO::PARAM_STR);

$stmt->bindParam(':over_14', $_POST['over_14'], PDO::PARAM_INT);
$stmt->bindParam(':over_14_low', $_POST['over_14_low'], PDO::PARAM_STR);
$stmt->bindParam(':over_14_high', $_POST['over_14_high'], PDO::PARAM_STR);
$stmt->bindParam(':over_14_Peak', $_POST['over_14_Peak'], PDO::PARAM_STR);

$stmt->bindParam(': over_30', $_POST['over_30'], PDO::PARAM_INT);
$stmt->bindParam(':over_30_low', $_POST['over_30_low'], PDO::PARAM_STR);
$stmt->bindParam(':over_30_high ', $_POST['over_30_high'], PDO::PARAM_STR);
$stmt->bindParam(':over_14_Peak ', $_POST['over_14_Peak '], PDO::PARAM_STR);
$stmt->bindParam(':tax', $_POST['tax'], PDO::PARAM_INT);

02-19-2014, 01:14 AM
found it!!! my baad tiepin again, i left spaces in the bind value s

:over_14_Peak ',
:over_30_high '
this cost me a lot of nervous energy

d a v e
02-19-2014, 07:47 AM
is there no php validator like an html or css one?

02-19-2014, 08:28 AM
um yes pdo even has its own catch error system but i had got so blind i missed it. plus my ide picks up stuff like that but i was just looking at the wrong stuff.
eventually i coded it differently and it spotted the original error, now i just have to find a way to blame someone else for it :)