PHP code example of luisaedev / flex-pdo
1. Go to this page and download the library: Download luisaedev/flex-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/ */
luisaedev / flex-pdo example snippets
uisaeDev\FlexPDO\FlexPDO;
// Create a new FlexPDO instance
$fpdo = new FlexPDO([
'dbname' => 'db-name',
'user' => 'username',
'password' => 'your-password'
]);
// Prepare a SQL statement
// Bind a 'status' parameter
// Execute it
$fpdo
->prepare('SELECT * FROM users WHERE status = :status')
->bind(':status', 1, 'int')
->execute();
// Fetch each result
while ($row = $fpdo->fetch()) {
print_r($row);
}