0

i used to use functions like this one:

 function data_user($dbc,$email){

  $q = "SELECT * FROM doctors WHERE email= ?";
  $stmt = mysqli_prepare($dbc, $q);
  mysqli_stmt_bind_param($stmt, "s", $email);
  mysqli_stmt_execute($stmt);
  $r = mysqli_stmt_get_result($stmt);
  return $r
}

and then i call them inside my html code like this:

$r = data_user($dbc,$email);
while($info = mysqli_fetch_assoc($r){
echo $info['user_name'];
}

it was working absolutely fine on my old server but then i moved my website to a new server which does not support mysqlnd so my website shows an error says that mysqli_stmt_get_result is undefined function, I have contacted my host support service and the said there is no way to install mysqlnd on the server so i need to change my code, I have tried many other solutions but none of them actually works as i want, any help is appreciated..

Omar Alhadidy
  • 109
  • 1
  • 9
  • 1
    Have you tried the solutions from this SO question? http://stackoverflow.com/questions/10752815/mysqli-get-result-alternative – IsThisJavascript Sep 27 '16 at 20:46
  • What PHP version are you using? Is there anyway you could change the PHP version you use? – Derek Pollard Sep 27 '16 at 20:47
  • @You Hidden in the question _I have contacted my host support service and the said there is no way to install mysqlnd on the server_ – RiggsFolly Sep 27 '16 at 20:49
  • @RiggsFolly - That would be true, however `mysqlnd` is compiled by default in `PHP 5.4`, and most hosts *do* give the user the option to use different stable versions of `PHP`. – Derek Pollard Sep 27 '16 at 20:52
  • @You I repeat the OP already asked that question and was told **I have contacted my host support service and the said there is no way to install mysqlnd on the server** I think that means they WONT do it rather than they cannot do it – RiggsFolly Sep 27 '16 at 20:53
  • @RiggsFolly - I highly doubt the host won't allow OP to use a different PHP version, especially considering the last release of PHP 5.3 (the last php version that didn't include `mysqlnd` by default) was over 2 years ago. – Derek Pollard Sep 27 '16 at 20:56
  • @You are missing the point. OP say mysqlind is missing. The host says they will not install it. This is a waste of both of our times. If the OP asks his host and says he was told by his host that they **will not install mysqlind** then we have to assume that the host does not want to for some reason. Probably to encourage somone on a cheap cheap plan to upgrade to a more expensive one! – RiggsFolly Sep 27 '16 at 21:04
  • 1
    @WillParky93 works :), thank you very much – Omar Alhadidy Sep 27 '16 at 21:06
  • my php version is 5.6.2 but the guy in the chat said that my server is shared with other users and can not be updated for one user only @You – Omar Alhadidy Sep 27 '16 at 21:09

0 Answers0