SQLite Tutorial in PHP
SQLite Tutorial in PHP
SQLite is an SQL database manager used locally or on a website, and compatible
in particularly with PHP.
Summary
Installing SQLite and creating a database
.
Installing SQLite. Verifying the installation by creating a base.
Creating and using a SQLite table
.
Creating a table. Deleting a table. Adding a record. Reading a record.
How to find and update a post
.
Filling a database. Dump of the whole base. Finding a record by ID. Searching a post. Updating a post.
Download
The complete source code of the scripts
in a ZIP archive.
More
SQLite and multi-users. How to treat concurrency issue with SQLite
.
相关文档:
1.直接使用mysql_insert_id()获取上一次插入的数据的AUTO_INCREMENT的变量的编号,比使用mysql语句获取方便极多。但注意要在query()后立刻使用,保证时间正确性,如多线程访问数据库是产生误差。
2.等号左右各留一空格,清晰便于阅读。
3.PHP中,单双引号均可以套string,区别在于:
"this is a simple $test" = 'this i ......
function get_web_page( $url )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page 返回网页
CURLOPT_HEADER => false, // 不返回头信息
CURLOPT_FOLLOWLOCATION => true, ......
PHP 5.2 及以上版本提供了 json_encode 和 json_decode 函数,相当好用。
而之前的版本则需要下载网友们自行开发的库(有兴趣的可以看下 http://code.itlearner.com/php/JSON-class.html )
可以参考如下这个方法来在低版本上扩充这两个函数:
if (!function_exists('json_encode') && !function_exists('j ......
转自本人个人网站 【PHP探路者
】,欢迎各位访问站点!
在使用PHP获取浏览器信息时,通常有两种方式:
第一种是:使用$_SERVER[HTTP_USER_AGENT]选项
此方式获取的是格式不规则的数据,如
Mozilla/4.0 (compatible; MSIE 8.0
; Windows NT 5.1; Trident/4.0; GTB6; CIBA; .NET CLR 2.0.50727)
Mozilla/5.0 (Windows ......