Bu sorunu nasıl çözebilirim

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/res/public_html/test2/functions.php on line 4

Warning: mysqli_num_rows() expects exactly 1 parameter, 2 given in /home/res/public_html/test2/functions.php on line 5

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home/res/public_html/test2/functions.php on line 8


Functions.php dosyası

require 'dbconfig.php';
function checkuser($fuid,$ffname,$femail){
$check = mysqli_query($connection, "select * from Users where Fuid='$fuid'");
$check = mysqli_num_rows($connetion, $check);
if (empty($check)) { // if new user . Insert a new record
$query = "INSERT INTO Users (Fuid,Ffname,Femail) VALUES ('$fuid','$ffname','$femail')";
mysqli_query($connection, $query);
} else { // If Returned user . update the user record
$query = "UPDATE Users SET Ffname='$ffname', Femail='$femail' where Fuid='$fuid'";
mysqli_query($query);
}
}
?>