PHP code example of soluble / dbwrapper
1. Go to this page and download the library: Download soluble/dbwrapper 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/ */
soluble / dbwrapper example snippets
use Soluble\DbWrapper;
$conn = new \mysqli($hostname,$username,$password,$database);
$conn->set_charset($charset);
$adapter = DbWrapper\AdapterFactory::createAdapterFromResource($conn);
$results = $adapter->query("select * from my_table");
foreach($results as $result) {
echo $result['my_column'];
}
$connection = $adapter->getConnection();
echo $connection->getCurrentSchema();
echo $connection->getHost();
$resource = $connection->getResource();