⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example4.php

📁 我收集的Sqlite的PHP模块
💻 PHP
字号:
<?php/* * you may need this line, depending on how you compile * this extension. */dl('sqlite3.so');/* * create a SQL function * * It will be called by sqlite3_exec() for each row in the result * set. */function get_sha1($x){	return sha1($x);}/* * create a SQLite3 handle.  * * Note: in-memory database are created by the magic keyword ":memory:" * */$db = sqlite3_open(":memory:");if (!$db) die ("Could not create in-memory database..");/* * Define a new SQL function: sha1, which takes * only one argument. * SQLite3 library will call the PHP function get_sha1()  * to get the result. * */if (!sqlite3_create_function($db, "sha1", 1, "get_sha1")) 	die("sqlite3_create_function() failed.");    $res =  sqlite3_query($db, "select sha1('my password')");if (!$res) die (sqlite3_error($db));$row = sqlite3_fetch_array($res);if (!$row) 	echo "error: " . sqlite3_error($db);else  	var_dump($row);sqlite3_query_close ($res);sqlite3_close($db);?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -