Book of Zeus has already given you the answer. This is for your future reference (and hopefully helps others in the future).
It is useful to learn to read error messages and try to figure out what might cause them. :)
This tells you exactly what the problem is and where to start.
Warning: mysqli_error() expects parameter 1 to be mysqli, null given.
A message tells you that the parameter 1 problem was provided by mysqli_error and that it was null when mysqli_error expected it to be mysqli .
So, look at the first parameter that you provide mysqli_error , and you will see its $dbc . Now you know that the problem is that $dbc is null when mysqli_error() called. So see how this $dbc can be null . Oh, right - you didn’t announce it and assign nothing, because the first place it used in the code is here:
$code = mysqli_real_escape_string ($dbc, $_GET['invite']);
and it is used as if it were already something other than null . Since this is at the beginning of your code, the problem is that you forgot to declare and initialize it by connecting to the database. The problem is solved. :)
source share