PHP code example of stechbd / sde

1. Go to this page and download the library: Download stechbd/sde 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/ */

    

stechbd / sde example snippets




$sde = new STechBD\SDE('name', 'username', 'password', 'host', 'prefix');

$sde->insert('users', 'name, email, password', ':name, :email, :password', [
    'name'      =>  'John Doe',
    'email'     =>  '[email protected]',
    'password'  =>  '123456',
    'salary'    =>  '10000'
]);

$sde->update('users', 'email = :email', 'id = :id' [
	'email' =>  '[email protected]',
	'id'    =>  1
]);

$sde->remove('users', 'id = :id', [
	'id' => 1
]);

$sde->select('*', 'users');

$sde->select('id, name, email', 'users');

$sde->select('id, name, email', 'users', 'id = :id', false, false, [
	'id' => 1
]);

$sde->select('id, name, email', 'users', 'id = :id', 10, false, [
	'id' => 1
]);

$sde->select('id, name, email', 'users', 'id = :id', '10, 0', 'id DESC', [
	'id' => 1
]);

$sde->select('id, name, email', 'users', 'id = :id', '10', 'id DESC', '15', [
	'id' => 1
]);

$sde->run('SELECT * FROM users WHERE id = 1');

$sde->json($result);

$sde->last();

$sde->count('users', 'id = :id', [
	'id' => 1
]);

$sde->sum('users', 'salary', 'id = :id', [
	'id' => 1
]);