WGOD!

The general member portfolio consists of software developers, company owners and investors. Our mission is to ensure that all shared content is clean and functional. For this reason, unfortunately, not every member is accepted. Please do not attempt to register for 1 software or 1 theme, membership is paid. You can join our telegram group below or send an e-mail to [email protected] to purchase the invite code for 10$.

Join Telegram

PHP PDO Class PDOx

Info

Konu Hakkında Merhaba, tarihinde PHP kategorisinde xNull  tarafından oluşturulan PHP PDO Class PDOx başlıklı konuyu okuyorsunuz. Bu konu şimdiye dek 1,076 kez görüntülenmiş, 9 yorum ve 0 tepki puanı almıştır...
Kategori Adı PHP
Konu Başlığı PHP PDO Class PDOx
Thread starter xNull 
Start date
Replies
Views
First message reaction score
Son Mesaj Yazan yhasin1485

xNull 

Namık Kemal
IRONSIDE
WarezM
this slowpoke moves Supporter
1,276
Resources
456
3,636
Warez Point
53,603ա
Turkish Liras
2,000₺
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
 
Guest
Help Users
  • No one is chatting at the moment.
  • aLeech:
    Guest wariclis has joined the room.
  • (Guest) wariclis:
    hi
    Quote
    (Guest) wariclis: hi
    Back
    Top