PHP change email address on account when logged in -
i trying enable user change password on account when logged in. however, cant seem work. do have suggestions? <?php if ($_post['submitemail']) { $newemail = $_post['email']; $newemail = stripslashes($newemail); $newemail = str_replace("'", "'", "$newemail"); //checks database see if email user types in exists $query = "select * users email = '$newemail'"; $result = mysqli_query($db_connection, $query); $nums = mysqli_num_rows($result); if ($nums >= 1) { //if email exists, inform user echo "email exists"; echo "<br/>click <a href = 'account.php?page=email'> here</a> try again"; } else { //if email not exist, update users email $querychange = "update users set email = '$newemail' id = '$userid'"; $result3 = mysqli_query($db_connection, $querychange); echo "your email has been changed"; ...