1. Go to this page and download the library: Download katropine/kmapper 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/ */
$DataObject = \KMapper\MySql::query("SELECT * FROM t1");
$DataObject = \KMapper\MySql::execute(
"SELECT * FROM `#__t1` WHERE id = ? AND age = ?",
array(
array(12,\PDO::PARAM_INT),
array(25, \PDO::PARAM_INT)
)
);
$DataObject = \KMapper\MySql::execute(
"SELECT * FROM `#__t1` WHERE id = :id AND age = :age",
array(
array(':id' => 12,\PDO::PARAM_INT),
array(':age' => 25, \PDO::PARAM_INT)
)
);
$options['connection'] = new KMapper\MySqlDbConnect('db1');
$DataObject = \KMapper\MySql::query("SELECT * FROM #__t1", $options);
$DataObject = \KMapper\MySql::execute("SELECT * FROM #__t1 WHERE id = ?", array(12), $options);