Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Basic inheritance class issue!


impact - 2:11 am on May 9, 2010 (gmt 0)


Hello,

I am new to PHP and struggling withe class inheritance.


Page name: DbConnectionClass.php

class DbConnectionClass{
protected $con;

protected function dbcon(){
$db = "abc";
$db_host = "localhost";
$db_user = "xyz";
$db_password = "******";
$this->dbCon =mysql_connect($db_host,$db_user,$db_password);
mysql_select_db($db);
}
}


Page name: LoginClass.php

include ("DbConnectionClass.php");
class LoginClass extends DbConnectionClass{

function loginuser($username,$password){
$this->dbcon();
-
-
-
mysql_close($this->con);
}

}

There seems to be some kind of problem with mysql_close statement and in general am I being wrong some where?

Thank you


Thread source:: http://www.webmasterworld.com/php/4129596.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com