smidwap
12-08-2002, 01:01 AM
I am writing a php script in which it would be very convenient to be able to call a class within another class.
The working class would look something like:
Class Template
{
$db = new DB;
function something ()
{
$db->mysql_something($someparams);
}
}
However, I have not found a way to use any functions or variables within the $db class. When running this php script (with of course all other required syntax), I get some php errors. I'm just curious if anyone knows a way to do this.
The working class would look something like:
Class Template
{
$db = new DB;
function something ()
{
$db->mysql_something($someparams);
}
}
However, I have not found a way to use any functions or variables within the $db class. When running this php script (with of course all other required syntax), I get some php errors. I'm just curious if anyone knows a way to do this.
