That query itself is not dependant on the Mysql version. Do you mean that Yahoo does not have Mysqli extension installed? What's the error you're getting?
If you mean to just correct the function then this would be it:
function emailChecker($email) {
global $check_res;
//check that email is not already in list
$query = sprintf("SELECT id FROM subscribers WHERE email='%s'", mysql_real_escape_string($email));
$check_res = mysql_query($query);
}
..althought I dont understand why you are setting $check_res as global. Why not just return it. Even better, handle the whole thing in the function and return either true or false depending on the result:
function emailChecker($email)
{
//check that email is not already in list
$query = sprintf("SELECT id FROM subscribers WHERE email='%s'", mysql_real_escape_string($email));
$result = mysql_query($query);
if (mysql_num_rows($result)>0)
{
// email was found
return true;
}
else
{
// email was not found
return false;
}
}
Actual usage with that function would be something like this. Lets say theres a new subscriber and he tries to subscripe again:
if (emailChecker($email))
{
// Already on the subscribers
$error = 'The email is already in use';
}
else
{
// Not on the list, add it
}