Pdo query problem

I have the code below.I know that the query has 1 column as result but the code return false for the row.
What is wrong?

 $query = "select ac_min_price,ac_final_date from auction_products 
where  ac_id=:bproduct";
    $idresults = $dbh->prepare(query);
    $idresults->bindParam(':bproduct', $binds);
    $binds =$_POST['cid']; 
    $idresults->execute();
    $row = $idresults->fetch(PDO::FETCH_ASSOC);
    print_r( $row);

I solve it.
$idresults = $dbh->prepare(query); is $idresults = $dbh->prepare($query);

error_reporting(E_ALL);
Is your best friend.

Unless you have the misfortune of working with an ancient codebase that kicks out over 7000 notice and warning level errors each time it runs (I’m not joking). :frowning:

Off Topic:

Or a script that kicks out 8 errors into an error log, and is cron’d to run every 60 seconds of the day…(2 GB log per day…)

Off Topic:

You too eh? Ancient code. Keeps us employed. One day PHP will pass away in favor of a better language, but I bet there will be a few of us left even then. Just like the COBOL guys today.