PHP5 what's wrong with my syntax?
- by myxospsm
Hey,
I've never developed before and I'm a bit puzzled, what is wrong with my syntax here?
private static $instance; //holder of Mongo_Wrapper
public $connected = true;
private $mongo = null; // The mongo connection affiliation
private $database = null; // The database we are working on
with this function:
public function mongo_connect($db_name) {
if (! self::connected) {
$this->mongo = new Mongo;
//TODO: error handle this whole sharade: throw new Kohana_Database_Exception('Cant connect', NULL, 503);
$this->connected = true;
}
$this->database = $this->mongo->$db_name; //set the database we are working on
return $connected;
}
I'm sorry, wmd-editor is giving me hell posting the code.
Thank you!