MySQL Error ({$errno}): (script has been terminated)
{$error}
Query: {$query}

HTML; } function error( $query = "No Query" ) { return $this->error_display( mysql_error(), mysql_errno(), $query ); } function connect( $database = "" ) { $this->conn = @mysql_connect( $this->inf['host'], $this->inf['user'], $this->inf['password'] ) or die( $this->error() ); $this->open( $database ); } function open( $database = "" ) { if ( $this->conn ) @mysql_select_db( ( empty( $database ) ) ? $this->inf['name'] : $database, $this->conn ) or die( $this->error() ); } function close() { @mysql_close( $this->conn ) or die( $this->error() ); } function query( $query ) { $this->cache[] = $query; $this->count++; $result = @mysql_query( $query, $this->conn ) or die( $this->error( $query ) ); if ( preg_match( "#^(INSERT|DELETE|UPDATE|REPLACE)\s+#is", $query ) ) { $this->affected_rows = $this->affected(); if ( preg_match( "#^(INSERT|REPLACE)\s+#is", $query ) ) $this->insert_id = mysql_insert_id( $this->conn ); return $this->affected_rows; } else return $result; } function fetch( $query, $return_type = 1 ) { if ( $return_type == 1 ) return mysql_fetch_object( $query ); else return mysql_fetch_assoc( $query ); } function execute( $query, $return_type = 1 ) { return $this->fetch( $this->query( $query ), $return_type ); } function count( $query ) { return mysql_num_rows( $query ); } function free( $query ) { if ( mysql_free_result( $query ) ) return true; else return $this->error; } function affected() { return mysql_affected_rows( $this->conn ); } function show_cache() { $cache = ''; foreach ( $this->cache as $k => $v ) $cache .= ''."\n"; $cache .= '
'.$k.' ->'.htmlentities($v).'
'; return $cache; } } ?>