Your need to define $db as a property of your sessions class.
e.g.
class sessions {
var $db;
function sessions {
$this->db = new mysql_connect;
}
function testprint() {
$this->db->connect()
}
}
$sess = new sessions;
$sess-> testprint();
-Original Message-
SNIP
> // This does not work -->
> class sessions {
> function sessions {
> $db = new mysql_connect;
> }
>
> function testprint() {
> $db-> connect()
> }
> }
This does not work as it shouldn't. You create $db in another function => other
function cannot use. Make it
2 matches
Mail list logo