#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    667
    Rep Power
    6

    Issue w/ my Prepared Statement?


    I run the query string manually and receive exactly what I intent to, but when I echo any of the to-be-set variables here, like at the end, $name shows up blank. Any ideas?

    PHP Code:
    if($_GET['action'] == "edit" || $_GET['action'] == "view") {
      
    $statement $link->prepare("SELECT `FLName`,`Position`,`Number`,`Type`,`E-mail`,`Note` FROM `rolodex` WHERE `CustomerID` = ?");
      
    $statement->bind_param('i'$_GET['id']);
      
    $statement->execute();
      
    $statement->bind_result($name,$position,$number,$type,$email,$note);
      
    $statement->close();
      
    $companyID $_GET['id'];
      echo 
    "Name: " $name "GET ID: " $_GET['id'];

    I receive Name: GET ID: 90

    I even replaced ? with 90 to comment out the bind_param line with no luck.
    Last edited by Triple_Nothing; February 22nd, 2013 at 04:01 PM.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    bind_result() only binds variables to columns. You still have to fetch() data.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    667
    Rep Power
    6
    Ah, no fetch(). Thank you very much. ^_^

IMN logo majestic logo threadwatch logo seochat tools logo