kurt.santo Posted May 5, 2008 Share Posted May 5, 2008 Using: $query = "SELECT user_id FROM users WHERE email='". escape_data($_POST['email']) . "'"; $result = mysqli_query ($dbc, $query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysqli_num_rows($dbc, $result) == 1) { I get the error message:mysqli_num_rows() expects exactly 1 parameter, 2 given $dbc has to be used with mysqli. What is going wrong here? Anyone knows what is wrong with my code?Kurt Link to comment Share on other sites More sharing options...
kurt.santo Posted May 5, 2008 Author Share Posted May 5, 2008 Using: $query = "SELECT user_id FROM users WHERE email='". escape_data($_POST['email']) . "'"; $result = mysqli_query ($dbc, $query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysqli_num_rows($dbc, $result) == 1) { I get the error message:mysqli_num_rows() expects exactly 1 parameter, 2 given $dbc has to be used with mysqli. What is going wrong here? Anyone knows what is wrong with my code?Kurt I just found how ignorant I was to assume you always have to use $dbc with any mysqli function. It works with "if (mysqli_num_rows($result) == 1)"... Sorry, to have bothered.Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.