Essential operations to get started with PDOdb.
Demonstrates database connection setup for all six database dialects (MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, Oracle).
Topics covered:
- SQLite connection with
:memory:database - MySQL connection with host, credentials, and database name
- PostgreSQL connection configuration
- Connection validation and error handling
Basic Create, Read, Update, Delete (CRUD) operations.
Topics covered:
- Creating (inserting) records with
insert() - Reading records with
get(),getOne(),getValue() - Updating records with
update() - Deleting records with
delete() - Working with primary keys and affected rows
Various WHERE clause patterns and operators.
Topics covered:
- Simple equality conditions
- Comparison operators (
>,<,>=,<=,!=) - Multiple AND/OR conditions
- IN operator for multiple values
- BETWEEN operator for ranges
- LIKE pattern matching
- IS NULL / IS NOT NULL checks
- NOT operator
- Complex conditions with raw SQL
Data manipulation patterns.
Topics covered:
- Single row inserts
- Bulk inserts with
insertMulti() - Conditional updates
- Updates with calculations
- Working with auto-increment IDs
- Affected row counts
Ordering query results with various syntaxes.
Topics covered:
- Single column ordering (ASC/DESC)
- Multiple column ordering (chained calls)
- Array syntax with explicit directions
- Array syntax with default direction
- Comma-separated string syntax
- Order by expressions (CASE WHEN)
- Mixed ordering methods
- Pagination with ordering
php 01-connection.phpPDODB_DRIVER=mysql php 01-connection.phpPDODB_DRIVER=pgsql php 01-connection.phpPDODB_DRIVER=sqlsrv php 01-connection.phpPDODB_DRIVER=oci php 01-connection.php- Query Builder Basics - Fluent API overview
- SELECT Operations - SELECT, FROM, WHERE
- Data Manipulation - INSERT, UPDATE, DELETE
- Filtering Conditions - WHERE clauses
After mastering these basics, explore:
- Intermediate Examples - JOINs, aggregations, transactions
- Advanced Examples - Connection pooling, bulk operations, subqueries, MERGE statements
- JSON Operations - Working with JSON data