Jump to content

clickbeast

New Members
  • Posts

    2
  • Joined

  • Last visited

clickbeast's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for helping me it finally worked . Both answers work thanks!
  2. Hello, I am new to mysqli and have a little question. I have tried to find an alternative for a while now but nothing seems to work... maybe somebody could help. So my old code is this function ($email) { $query = mysql_query("SELECT COUNT(`user_id`) FROM users WHERE email = '$email'")or die (mysql_error()); return (mysql_result($query, 0) == 1) ? true : false; } after that the function is used like this : if (login_email_exists($mysqli,$_POST['email']) === true) { $errors[] = 'Sorry this email adress is already in use.'; } And my new code is this function ($mysqli,$email) { $query = $mysqli->query("SELECT COUNT(`user_id`) FROM users WHERE email = '$email'")or die (mysql_error()); return ($query == 1) ? true : false; } Now it seems to always go wrong when I want to check the result and return if it's true or false. If anybody can find an answer or alternative to my problem I would be very happy.
×
×
  • 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.