function connectMySQL()
{
$link = mysqli_connect("localhost", "", "", "");
global $link;
return $link;
}
function checkCredentials($username, $password)
{
connectMySQL();
print_r($link);
}
When using checkCredentials function, I get the following error:
Notice: Undefined variable: link in C:\xampp\htdocs\zone\funcs.php
If I add the following code to the connectMySQL function, all the correct information is shown
print_r($link);
exit();
It's just when the function is called in the checkCredentials function that it says it is undefined. I don't believe this happened before I started switching code to MySQLi