I have a file that is included. In that file is a function and I need it to return a value to the main page, but this is not working.
This is a simple call to check the number of logins for a user, I put in the echo statements for error checking (to see what is going on)
On main page:
include_once("functions.php");
check_logins();
echo "<br>outside function: " .$logins;
On functions.php
function check_logins()
{
$check=db_query(" select logins from users where name='{$logged["name"]}' ");
$logins=db_result($check,0,0);
echo "<br>inside function: " .$logins;
return $logins;
}
(BTW: I have predefined functions of what db_query and db_result are, so the database queries are working correctly)
On my screen I get this:
inside function: 5
outside function:
There is no value being returned
I have tried:
return $logins;
return ($logins); //space after return
return($logins); //no space
None of this seems to work, anything I'm doing wrong?