$UserID,$Pass are parameters to the class, but also global variables inside the class. $Total_Users is global inside the class and is not defined outside the class so your if is looking into a variable that does not exist. Problem is you have 5 not 3 variables. The variables defined by var inside the class should be called by
$this->%variable here%
When your un the SQL you use the $UserID,$Pass combination sent to the class through the constructor not the ones defined as var, which are still null.
Finally you're not returning Total_Users
Try
class Jazit_Login_Class {
var $UserID;
var $Pass;
var $User_Query;
var $Total_Users;
var $link;
function Jazit_Login_Function($UserID,$Pass) {
$link=mysql_connect("localhost","jazbot","Jzb80032");
if(!$link)die("Could not connect");
mysql_select_db("jazbot") or die("Could not open database");
$User_Query=mysql_query("SELECT * FROM Login WHERE UserName=\"$UserID\" AND UserPass=\"$Pass\" LIMIT 1");
$Total_Users=mysql_num_rows($User_Query);
return $Total_Users;
// this code is never reached
if (!$User_Query) {echo("<p>Error performing query: " . mysql_error() . "</p>");}
}
}
$New_Login = new Jazit_Login_Class;
$Total_Users=$New_Login->Jazit_Login_Function("lisa","jazz");
// this works only if the dbase returns one and only one row
if($Total_Users=="1"){echo"it works!";}
else{echo"dumbass";}
// this works with any amount of rows returned above 0
if($Total_Users>"0"){echo"it works! got many rows";}
else{echo"dumbass";}