PHP PDO Class PDOx

xNull 

Namık Kemal
Platinium
Gold
Shell+
IRONSIDE
LV
11
 
Awards
8
Warez Point
4,904.3
Username Style
Profile Music ( MP3 Çalsın )
Online
Connect:

PHP:
require 'vendor/autoload.php';

$config = [
    'host'        => 'localhost',
    'driver'    => 'mysql',
    'database'    => 'test',
    'username'    => 'root',
    'password'    => '',
    'charset'    => 'utf8',
    'collation'    => 'utf8_general_ci',
    'prefix'     => ''
];

$db = new \Buki\Pdox($config);

$records = $db->table('users')
        ->select('id, name, surname, age')
        ->where('age', '>', 18)
        ->orderBy('id', 'desc')
        ->limit(20)
        ->getAll();

var_dump($records);

İNSERT:
PHP:
$data = [
    'name' => 'Burak',
    'surname' => 'Demirtaş',
    'age' => '24',
    'country' => 'Turkey',
    'city' => 'Ankara',
    'status' => 1
];

$query = $db->table('users')->insert($data);

if($query)
{
    echo 'Record added! <br />' .
         'InsertID: ' . $db->insertId();
}
DELETE:
PHP:
$query = $db->table('pages')->where('year', 2014)->where('status', 0)->delete();

if($query)
{
    echo 'Record(s) deleted!';
}


UPDATE:

PHP:
$data = [
    'username' => 'new-user-name',
    'password' => md5('new-password'),
    'status' => 1
];

$query = $db->table('users')->where('id', 17)->update($data);

if($query)
{
    echo 'Record updated!';
}

SELECT:
PHP:
$records = $db->table('users')
        ->select('name, surname, age')
        ->where('age', '>', 18)
        ->orderBy('id', 'desc')
        ->limit(20)
        ->getAll();

foreach($records as $record)
{
    echo $record->name . '<br />' .
         $record->surname . '<br />' .
         $record->age;
}




İNDİR
 

DMCA & Contact


Any DMCA takedown notice should be sent to this contact email: [email protected] We only respond and take action to plaintext e-mails. Do not send PDF or any other files.
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock