Hello!
I redo the store script from mysql to mysqli. I did the main thing, but I can’t cope with checking the login login. User data is written to the database. Here is the code (here, when registering when a login is busy, a warning appears):
function check_login($user) { db_connect(); $query = sprintf(" SELECT username FROM users WHERE users.username = '%s' ", mysqli_real_escape_string($user)); $result = mysqli_query($query); if(mysqli_num_rows($result) > 0) return FALSE; else return TRUE; } Here is the new code (here the user with the same login is entered into the database again):
function check_login($user) { global $link; $query = sprintf(" SELECT username FROM users WHERE users.username = '%s' ", mysqli_real_escape_string($user)); $result = mysqli_query($link, $query); if(mysqli_num_rows($result) > 0) return FALSE; else return TRUE; } Thanks in advance for your help!