I recently emulated an old code for Mysqli and it is giving errors.
Erro:
Notice: Undefined variable: connection in /var/www/public_html/includes/functions.php on line 8
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /var/www/public_html/includes/functions.php on line 8
Warning: mysqli_query() expects at least 2 parameters, 1 given in /var/www/public_html/includes/functions.php on line 9
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /var/www/public_html/includes/functions.php on line 10
Code:
function idinfo($id,$value) {
$id = mysqli_real_escape_string($connection, $id);
$sql = mysqli_query("SELECT * FROM purchasify_users WHERE usern='$id'");
$row = mysqli_fetch_array($sql);
return $row[$value];
}