I rewrote my admin class and it did not work.
Heres a little more information:
class 1 - a mysql class
class 2 - just some class
I need to use class 1 as it is, by itself. I have some scripts that use the functions in it. So therefore its contents can not change.
I have another class (class 2) that uses a database, so the easiest way to do that would be to use the functions in class 1.
I tested it and everything works okay until this happens... in class 1 (database) vars stored ($this->somevar) in the class do not work. lets give an example:
$CLASS = new testclass;
class testclass
{
var $testclass2;
function testclass()
{
$this->sql = new testclass2;
}
function testfunction($test)
{
$this->testclass2->echo($test);
}
}
class testclass2
{
var $test;
function echo($test)
{
$this->test = $test;
$this->print();
}
function print()
{
echo $this->test;
}
}
If i were to run this command $CLASS->testfunction("helloworld"); it would not work. I beleve its because in testclass2 its not remembering what $this->test contains. Perhaps im talking in circles or something. I dont know, but i am stumped.
-Scott