1. Go to this page and download the library: Download davewid/peyote library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
davewid / peyote example snippets
sql
SELECT * FROM user WHERE user_id = ?
php
$query = new \Peyote\Select('user');
$query->where('user_id', '=', 1);
echo $query->compile();
// output: SELECT * FROM user WHERE user_id = ?
php
$data = array(
'email' => "[email protected]",
'password' => "youllneverguess"
);
$query = new \Peyote\Insert('user');
$query->columns(array_keys($data))->values(array_values($data));
echo $query->compile();
// output: INSERT INTO user (email, password) VALUES (?, ?)
php
$data = array(
'password' => "iguesssomebodyguessed"
);
$query = new \Peyote\Update('user');
$query->set($data)->where('user_id', '=', 1);
echo $query->compile();
// output: UPDATE user SET password = ? WHERE user_id = ?
php
$query = new \Peyote\Delete('user');
$query->where('user_id', '=', 1);
echo $query->compile();
// output: DELETE FROM user WHERE user_id = ?