您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php访问sqlite数据库的例子

2025/11/12 11:59:14发布25次查看
if ($dbconn) {
sqlite_query($dbconn, create table animal(name varchar(255), maxage int);); sqlite_query($dbconn, insert into animal values ('a', 15)); $result = sqlite_query($dbconn, select name from animal); var_dump(sqlite_fetch_array($result, sqlite_assoc)); } else { print connection to database failed!\n; }
复制代码
例2,将结果集保存到数组中
复制代码
附,sqlite error constants
sqlite_ok no error occurred. sqlite_error sqlite error (or database not found). sqlite_internal an internal sqlite error. sqlite_perm access permission denied. sqlite_abort callback routine aborted. sqlite_busy the database file is currently locked. sqlite_locked a table within the database is locked. sqlite_nomem sqlite memory allocation error. sqlite_readonly an attempt to write to a read-only database. sqlite_interrupt interrupted operation. sqlite_ioerr a file i/o error has occurred. sqlite_corrupt the specified database is corrupted. sqlite_full database is full. sqlite_cantopen could not open database file. sqlite_protocol database lock protocol error. sqlite_schema the database schema changed. sqlite_toobig too much data for a single row. sqlite_constraint abort due to constraint violation. sqlite_mismatch data type mismatch. sqlite_auth authorization denied. sqlite_row sqlite_step() has another row ready. sqlite_done sqlite_step() has finished executing.
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product