ok here is the login function from my class user which parent class is a Db connection file
<?php
require_once("DBConnection.php");
class User extends DBConnection
{ ....
....
...
...
public function Login()
{
$sqlSelect = "select `UserName` from `user` where `UserName` = '$this->userName' and `Password` = '$this->password'";
$result = @mysql_query($sqlSelect, $this->get_Conn());
// $dataCount = mysql_num_rows($result);
if(mysql_num_rows($result) == 0)
{
throw new Exception("Login Failed");
}
$userData = mysql_fetch_assoc($result);
extract($userData);
$this->userId = $UserId;
$this->firstName = $FirstName;
$this->middleName = $MiddleName;
$this->lastName = $LastName;
$this->email = $Email;
$this->userName = $UserName;
$this->password = NULL;
$this->loginStatus = true;
$_SESSION['objUser'] = serialize($this);
if($remember)
{
$struser = serialize($this);
$expTime = time() + (60*60*24*7);
setcookie("objUser", $struser, $expTime, "/");
}
}
when from the login page i press login button it just checks for the values inside the box for error and chekcing the array error() its empty it stays on the same page