PHP5 what's wrong with my syntax?

Posted by myxospsm on Stack Overflow See other posts from Stack Overflow or by myxospsm
Published on 2011-01-09T01:45:54Z Indexed on 2011/01/09 1:53 UTC
Read the original article Hit count: 490

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about php5

Related posts about mongo