Documentation
SPHPlayground manual
sphplayground
sphplayground

Database manipulation

Db manages PDO database connections and acts as a factory for all SQL statement builder objects.

SQL table creation codes for example tables:

Inserting records

The Insert object executes declarative INSERT statement in SQL databases.

Quering data

The Query object executes declarative SELECT queries in SQL databases. It retrieves data from one or more SQL tables, or expressions and it has no persistent effects on the database.

Some essential Query methods:

Updating records

The Update object executes declarative UPDATE statement in SQL databases.

An Update object changes the data of one or more records in a table. Either all the rows can be updated, or a subset may be chosen Update::where().

Deleting records

The Delete object removes one or more records from a table. A subset may be defined for deletion using a condition, otherwise all records are removed.