db_name = $str_dbname; // execute connection $this->connect(); } /** * Method to invoke connection to RDBMS * * @return void */ private function connect() { $this->res_conn = @sqlite_open($this->db_name, 0666, $this->error); if ($this->error) { parent::showError(true); } } /** * Method to create/send query to RDBMS * * @param string $str_query * @return object */ public function query($str_query = '') { if (empty($str_query)) { $this->error = 'Cant send query because query was empty'; parent::showError(true); } else { $_result = new simbio_sqlite_result($str_query, $this->res_conn); $this->affected_rows = $_result->affected_rows; $this->errno = $_result->errno; $this->error = $_result->error; $this->insert_id = $_result->insert_id; // return the result object if ($this->error) { return false; } else { return $_result; } } } /** * Method to escape SQL string * * @param string $str_data * @return string */ public function escape_string($str_data) { return sqlite_escape_string($str_data); } /** * Method to close RDBMS connection * * @return void */ public function close() { @sqlite_close($this->res_conn); } } ?>