PHP code example of haikara / sequel-pdo

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

    

haikara / sequel-pdo example snippets


$sql = <<< SQL
    SELECT *
    FROM items
    WHERE
        deleted_at IS NULL
        AND id = :item_id
    SQL;
$values = [
    'item_id' => 1
];

$stmt = $db->exeQuery($sql, $values);
$item = $stmt->fetch();

$sql = <<< SQL
    SELECT *
    FROM items
    WHERE
        deleted_at IS NULL
        AND id = ?
    SQL;
$values = [
    'item_id' => 1
];

$stmt = $db->exeQuery($sql, $values, SequelPDO::QUESTION);
$item = $stmt->fetch();