Home > Article > Backend Development > Can PHP be used with sqlite?
How to enable the use of SQLite in PHP
##php default settings do not support sqlite database, in PHP 5.1.x In the future, it will come with the SQLtie database function, which only needs to be turned on in the configuration
PHP.ini (recommended learning:PHP programming from entry to proficiency)
;extension=php_sqlite.dll
After PHP 5.2.x, it comes with the SQLtie PDO database function. You only need to enable it in the configuration.
PHP.ini;extension=php_pdo_sqlite.dllCreate a SQLite database Two methods1. Use PHP function to directly open and createsqlite_open ("php100.db"); If the database exists, open it directly, if not, create a new one2. Through SQLiteManager To create and manage SQLite database filesFamiliar with common SQLite functions
sqlite_open(数据库名,模式,错误信息);打开数据库 sqlite_query(数据库连接参数,SQL参数);数据库执行 sqlite_num_rows(SQL返回句柄); 统计条数 sqlite_last_insert_rowid(数据库连接参数); 最后一条ID sqlite_fetch_array(SQL返回句柄,返回索引); 数据库指针
The above is the detailed content of Can PHP be used with sqlite?. For more information, please follow other related articles on the PHP Chinese website!