SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Mar 2006
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?
    Code:
     $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);

  2. #2
    SitePoint Guru
    Join Date
    Mar 2006
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I solve it.
    $idresults = $dbh->prepare(query); is $idresults = $dbh->prepare($query);

  3. #3
    SitePoint Guru
    Join Date
    Nov 2003
    Location
    Huntsville AL
    Posts
    689
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    error_reporting(E_ALL);
    Is your best friend.

  4. #4
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ahundiak View Post
    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).

  5. #5
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Michael Morris View Post
    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).
    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...)

  6. #6
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •