Below is the start of a new piece code I’m working with. But I want to add some code so it also selects/checks the entered e-mail. How can I do this? I know basically how to set up the bind_param code, but not the prepare statement with multiple items. I hope that makes sense. If anyone can help, I’d appreciate it!
if ($stmt = $db->prepare('SELECT * FROM xf_user WHERE username = ?')) {
// Bind parameters (s = string, i = int, b = blob, etc), in our case the username is a string so we use "s"
$stmt->bind_param('s', $_POST['username']);
$stmt->execute();
// Store the result so we can check if the account exists in the database.
$stmt->store_result();
}