/**
* SQLite class
* 2009-5-6
* Lian Wanchun
*
*/
class SQLite {
// Current SQL command
public $_mQueryStr = '';
// Current result
public $_mResult = null;
// SQLite connection handle
protected $_mSqlite;
// Warning message
protected $_mErrorInfo;
/**
* Database connection construction class
*
* @param string $databaseFile database file
* @return unknown
*/
public function __construct($databaseFile){
if(file_exists($databaseFile)){
$ this->_mSqlite = new PDO('sqlite:'.$databaseFile);
}
}
/**
* The database has statement operations that return results
*
* @param srting $sql SQL statement
* @return unknown
*/
public function getAll($sql){
if (empty($sql)) {
$this->_mErrorInfo=" SQL statement error";
return false; ; 🎜> return array();
}
execute(); $this->_mResult = $result->fetchAll();
if ( false == = $this->_mResult) {
return array();
}
return $this->_mResult;
}
/**
* Perform INSERT, DELETE, UPDATA operations
*
* @param srting $sql SQL statement
* @return unknown
*/
public function query($sql){
/ /$this->_mSqlite->exec($sql)or die(print_r($this->_mSqlite->errorInfo()));
$this->_mSqlite->exec($ sql);
return true;
}
/**
* Return error message
*
* @return unknown
*/
public function setError(){
return $this->_mErrorInfo;
}
}
?>
http://www.bkjia.com/PHPjc/320137.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320137.htmlTechArticleCopy the code as follows: ? /*** SQLite class * 2009-5-6 * Lian Wanchun **/ class SQLite { // Current SQL command public $ _mQueryStr = ''; // Current result public $_mResult = null; // SQLi...