Trongate PHP Framework Docs
Introduction
Basic Concepts
Understanding Routing
Intercepting Requests
Module Fundamentals
Database Operations
Templates
Helpers
Form Handling
Working With Files
Image Manipulation
Working With Dates & Times
Authorization & Authentication
Tips And Best Practices

Getting Connected

With Trongate, everything gets handled by modules. That includes database interaction.

Trongate v2 comes with a DB module for querying databases. The DB Module talks to MySQL and MariaDB. That’s the deal. Other databases? Possible, but you're on your own.

The Config File

All connection details live in config/database.php.

A fresh Trongate install gives you this:

Edit. Refresh. Done.

Multiple Databases? Yes.

Add as many groups as you want:

Controllers can only use the default database connection.

Model files can use any database group you define:

Secondary databases = models only. Keeps architecture sane.

What You’ll Learn Next

  • How to use the db module
  • Fetching, inserting, updating, deleting records
  • Raw queries + prepared statements
  • Debug mode that actually shows you the SQL