public function __construct( $whereto ) { $this->table =& $whereto['host']; $this->db = DB::getInstance(); print "
"; print_r( $this->db ); print "
"; // make sure our table exists in the database try { $query = $this->db->prepare( "CREATE TABLE IF NOT EXISTS ? ( `id` longint unsigned auto_increment primary key, `timestamp` TIMESTAMP, `type` ENUM('info','notice','warning','error','debug'), `message` LONGBLOG ) type=MyISAM" ); $query->bind_param('s', $this->table); $query->execute(); print "
"; print_r( $query ); print "
"; } catch( Exception $e ) { throw new Log_Exception( 'DB_CREATE_TABLE_FAIL', $e->getMessage() ); } }