All pastes #780242 Raw Edit

Failed prepare

public text v1 · immutable
·published 2007-11-18 15:11 UTC
rendered paste body
	public function __construct( $whereto ) {
		$this->table =& $whereto['host'];
		$this->db = DB::getInstance();
		
		print "<pre>"; print_r( $this->db ); print "</pre>";
		
		// 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 "<pre>"; print_r( $query ); print "</pre>";
		}
		catch( Exception $e ) {
			throw new Log_Exception( 'DB_CREATE_TABLE_FAIL', $e->getMessage() );
		}
		
	}