Class as member of class??
Posted: Fri May 07, 2010 7:57 am
Hey guys I'm trying to create an instance of a class inside another class. I know that inheritance is normally a good idea, but in this case I'm not so sure.
Here is the code:This throws the following error:
Thanks in advance for anyone's help! 
Here is the code:
Code: Select all
<?php
require_once('Class_SQL_Manager.php');
class User_Access{
private $sql = new SQL_Manager();
private $site_cookie;
function get_cookie()
{
$this->sql->init();
$this->site_cookie = $this->sql->get_array("Select Str_Value from control where Key_Value = 'COOKIE_NAME'");
printf($this->site_cookie['Str_Value']);
$this->sql->close_SQL();
}
}
?>Code: Select all
Parse error: syntax error, unexpected T_NEW in C:\XAMPP\xampp\htdocs\site\include\Classes\Class_User_Access.php on line 5