0

I'm trying to do something, but it doesn't work out, the primary suspect is incorrect query, but I don't know whether it's correct or not. I could try running it in phpMyAdmin, but then I don't know how these are escaped. The result is: array(5) { ["current_field"]=> NULL ["field_count"]=> NULL ["lengths"]=> NULL ["num_rows"]=> NULL ["type"]=> NULL }. So I figured maybe the query, maybe something else.

mysqli_query("SELECT * FROM members WHERE email='" . $_POST["inputEmail"] . "' OR username='" . $_POST["inputUsername"] . "'");

Does this get parsed properly? Given that $_POST's are alphanumerical?

Edited by Aeonix

3
Contributors
2
Replies
23
Views
1 Year
Discussion Span
Last Post by RudyM
0

Ah, this is a simple fix. You don't put the query in the mysqli_query()

This is what you would do:

$sql= "SELECT * FROM member WHERE email='" . $_POST['inputEmail']. "'";
 $result = mysqli_query($conn, $sql);

and the $conn would be the variable you have for the connection to the database, so that name could be different in yours for your connect.
Hope this helps!

Edited by TheFearful: forgot to add something

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.