Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
- Form Handling Fundamentals
- Creating Forms
- Form Input Fields
- Textareas and Dropdowns
- Checkboxes and Radio Buttons
- Form Labels
- Retrieving Form Data
- Form Validation Basics
- Displaying Validation Errors
- The Create/Update Pattern
- CSRF Protection
- Custom Validation Rules
- Form Helper Reference
- Validation Rules Quick Reference
- Best Practices For Handling Data
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Database Interaction Methods
The db module contains one file: modules/db/Db.php.
Inside lives a single, no-BS PHP class packed with every database method you'll ever need for database interaction.
Use it exactly like any other module:
// Fetch records.
$members = $this->db->get('username', 'members');
// Insert new records.
$data = [
'product_name' => 'Rolex Explorer',
'price' => 12000
];
$this->db->insert($data, 'items');
// Safely execute a custom query.
$params['last_name'] = 'Shakespeare';
$sql = 'SELECT * FROM authors WHERE last_name = :last_name';
$rows = $this->db->query_bind($sql, $params, 'object');
No magic. No hidden layers. Just Native PHP doing what it does best.
All The Methods
Everything you need is right here. Click any method for full popup docs. Or just open the Db.php file and read the source.
Data Retrieval
- included-db-get()
- included-db-get_where()
- included-db-get_one_where()
- included-db-get_where_in()
Data Manipulation
- included-db-insert()
- included-db-insert_batch()
- included-db-update()
- included-db-delete()
Analysis & Management
- included-db-count()
- included-db-describe_table()
- included-db-table_exists()
- included-db-get_tables()
Raw / Custom Queries
- included-db-query()
- included-db-query_bind()
Seriously: ignore this page and open modules/db/Db.php.
The source code is the only documentation that you'll ever need!