Jump to content

bind_result


eMonk

Recommended Posts

What am I doing wrong in the code below? 

$qry1 = $db->prepare("SELECT id FROM user WHERE username = ? AND password = ?");
$qry1->bind_param('ss', $_GET['username'], sha1($_GET['password']));
$qry1->execute(); 

$db->bind_result($result_1);

Fatal error: Call to undefined method mysqli::bind_result()

Link to comment
Share on other sites

I'm trying this now but still getting an error:

 

Fatal error: Call to undefined method mysqli_stmt::get_result()

$result_1 = $qry1->get_result();

I'm new to mysqli prepared statements been reading about it online and in my php book but can't seem to figure this part out?

Link to comment
Share on other sites

i recommend you make use of the php.net documentation. there are examples and conditions/limitations listed in the documentation.

 

a) why did you switch from using ->bind_result()?

 

b) there's a very specific restriction for when ->get_result() is available -

 
MySQL Native Driver Only

Available only with mysqlnd.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.