Lightweight database SQLite combined with PHP Development _ PHP Tutorial

Source: Internet
Author: User
Lightweight database SQLite combined with PHP development. SQLite is a lightweight database. it is designed to be embedded and has been used in many embedded products. it occupies very low resources, SQLite is a lightweight database in embedded devices. it is designed to be embedded and has been used in many embedded products. it occupies very low resources, in an embedded device, only a few hundred KB of memory is required. It supports mainstream operating systems such as Windows, Linux, and Unix, and can be combined with many programming languages, such as Tcl, php (as the mainstream development language), and Java, there are also ODBC interfaces, which are faster than MySQL (the best combination with PHP) and PostgreSQL, two open-source and world-famous database management systems.

Although SQLite is small, the supported SQL statements are not inferior to those of other open-source databases. the supported SQL statements include:

ATTACH DATABASE
BEGIN TRANSACTION
Comment
COMMIT TRANSACTION
COPY
CREATE INDEX
CREATE TABLE
CREATE TRIGGER
CREATE VIEW
DELETE
DETACH DATABASE
DROP INDEX
DROP TABLE
DROP TRIGGER
DROP VIEW
END TRANSACTION
EXPLAIN
Expression
INSERT
On conflict clause
PRAGMA
REPLACE
ROLLBACK TRANSACTION
SELECT
UPDATE

It also supports transaction processing. Some people also say that it is like Microsoft's access (a favorite of small websites). sometimes it is a bit like it, but in fact they are quite different. For example, SQLite supports cross-platform, simple operations, and can directly create databases in many languages. Unlike access (a favorite of small websites), SQLite requires Office support. If you are a very small application or want to do embedded development without a suitable database system, you can now consider using SQLite. Its latest version is 3.2.2, and its official website is: http://www.sqlite.org, which can get the source code and documentation above. At the same time, because the database structure is simple and the system source code is not much, it is also suitable for professionals who want to study database system development.

Now let's start with a brief introduction. I want to clarify a few questions: first, how to install and use php and how to develop php in combination as the mainstream development language.

I. Installation

1. Windows Platform

Download files under windows, is actually a command line program, (: http://www.sqlite.org/sqlite-3_2_2.zip), this command line program is used to include the generation of database files, execution of SQL queries, backup database and other functions.
After the download, for example, we extract to the D: Downloadssqlitesqlite-3_2_2 directory, then we enter cmd, and enter the directory:
Cd D: Downloadssqlitesqlite-3_2_2
D: Downloadssqlitesqlite-3_2_2> sqlite3 test. db
# If test. db does not exist, a database file is generated. If yes, the database file is directly used, which is equivalent to the use in MySQL (the best combination with PHP ).
SQLite version 3.2.2
Enter ". help" for instructions
Sqlite>
# SQLite prompt. if you want to view the command help input. help, all system commands in sqlite start:
Sqlite>. help
. Databases List names and files of attached databases
. Dump? TABLE? ... Dump the database in an SQL text format
. Echo ON | OFF Turn command echo on or off
. Exit Exit this program
. Explain ON | OFF Turn output mode suitable for EXPLAIN on or off.
. Header (s) ON | OFF Turn display of headers on or off
. Help Show this message
. Import file table Import data from FILE into TABLE
. Indices TABLE Show names of all indices on TABLE

...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.