Sending Database Requests

Database Actions

A database action defines what format the function should return the data it retrieves from the database in. For more information on Database Actions please see the actions page.

Select

The Select() function allows you to select information from the database.

Select(string $what, string $from, string|null $where, string $action, string|null $order = null, string|null $limit = null)

Parameters

Example: Selecting the logged in user.

use Saturn\DatabaseManager\DBMS;
$DB = new DBMS();

// Returns the first value as a JSON object.
$DB->Select('*', 'user', 'uuid = '.$_SESSION['uuid'], 'first:object');

Insert

The Select() function allows you to insert information into the database.

Insert(string $into, string $columns, string $values);

Parameters

Example: Creating a new page.

use Saturn\DatabaseManager\DBMS;
$DB = new DBMS();

$DB->Insert("pages", "`id`,`url`,`title`,`content`", "NULL, '/test', 'Test page', 'This is a test page.'");

Last updated