Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 97 | All time: 9,848 This week: 101 |
Version | License | PHP version | Categories | |||
sapi 1.0 | MIT/X Consortium ... | 8.1 | Tools |
Description | Author | ||||||||
This package can perform everyday database operations using PDO. |
|
Simple CRUD api system.
This is a simple API class meant to be easy to use without to much configuration.
The minimum setup needed to use the Logger class.
<?php
require_once("vendor/autoload.php");
use Kuran\SApi\Api;
$db = new PDO();
$sqlQuery = "SELECT
users.name,
users.email,
users.address
FROM users";
$queryParams = [];
$api = new Api($db);
$api->setQueryString($sqlQuery);
echo $api->readAll($queryParams);
$sqlQuery = "SELECT
users.name,
users.email,
users.address
FROM users
WHERE users.id = :id
AND users.name = :name";
$queryParams = ["id" => 2, "name" => "username"];
$sqlQuery = "SELECT
users.name,
users.email,
users.address
FROM users
WHERE users.id = ?
AND users.name = ?";
$queryParams = [2, "username"];
// readAll().
// Will fetch all matching rows from the database.
$api->readAll(array());
//readOne().
// Will fetch one matching row from the database.
$api->readOne(array());
//create().
// Insert data to the database
$api->create(array());
//update()
// Will update a row from the database.
$api->update(array());
//delete()
// Will delete an entry from the database
$api->delete(array());
Files (4) |
File | Role | Description | ||
---|---|---|---|---|
src (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Read me |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.