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 ......
在PHP中使用过SESSION的朋友可能会碰到这么一个问题,SESSION变量不能跨页传递。这令我苦恼了好些日子,最终通过查资料思考并解决了这个问题。我认为,出现这个问题的原因有以下几点:
1、客户端禁用了cookie
2、浏览器出现问题,暂时无法存取cookie
3、php.ini中的session.use_trans_sid = 0或者编译时没有打开--enable ......
PHP解疑
1. 代码重用方法include()和require()函数差异?
1) Require()函数
使用requier()包含外部php文件时,只要自身php文件被执行,外部文件的内容就将被包含进该自身php文件,当包含的外部文件发生错误时,系统将给出错误提示,并且停止php文件的执行。
示例:
调用文件config.inc的程序代码:
<?php ec ......
PHP的发展
PHP 原本的简称为 Personal Home Page,是Rasmus Lerdorf 为了要维护个人网页,而用c语言开发的一些CGI工具程序集,来取代原先使用的 Perl 程序。最初这些工具程序用来显示 Rasmus Lerdorf 的个人履历,以及统计网页流量。他将这些程序和一些表单直译器整合起来,称为 PHP ......
转自本人个人网站 【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 ......