-1

So i have done my whole project using mysqli prepared statements.Now my hosting providers are saying that "mysqlnd is not supported in our cloud servers". My code looks like

$stmt = $con->prepare("SELECT * FROM hr_admin WHERE email = ? AND password = ? ");
$stmt->bind_param('ss', $_POST['username'], $_POST['password']);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > "0")
{
$member = $result->fetch_assoc();

I really need a alternative for this code.Please don't mark as duplicate because i search whole but could not find a proper replacement.I got replacements for get_result() & $result->fetch_assoc(); but not for ($result->num_rows > "0") . I want to use PDO but as my whole project is in this. I badly need help.

Pooojaaaa
  • 183
  • 1
  • 4
  • 16

1 Answers1

0

You don't need alternatives for $result->num_rows > "0" because you don't need this condition at all:

$result = $stmt->get_result();
$member = $result->fetch_assoc();
if ($member)
{
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
  • `$result = $stmt->get_result();` `$member = $result->fetch_assoc();` There are the ones not working – Pooojaaaa Jun 21 '16 at 07:53
  • you said in your question that you "got replacements for get_result() & $result->fetch_assoc();" Can you make your mind, please? – Your Common Sense Jun 21 '16 at 07:54
  • Yeah got it after posting the comment – Pooojaaaa Jun 21 '16 at 07:55
  • [link](http://stackoverflow.com/questions/10752815/mysqli-get-result-alternative) i was referring to this but it's not working .. – Pooojaaaa Jun 21 '16 at 08:00
  • So you want a magic wand that will make your code work without any rewrite nor installing mysqlnd nor any other effort on your side? Good luck in search - that's all I can say. – Your Common Sense Jun 21 '16 at 08:18
  • You don't have to be rude.. I dont want any magic wand, i just want to sorted out my problem. U ve no idea the efforts m giving. – Pooojaaaa Jun 21 '16 at 08:27