PHP code example of easeappphp / pdolight

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

    

easeappphp / pdolight example snippets



\EaseAppPHP\PDOLight\PDOLight;

$dbHost = "localhost";
$dbUsername = "database_username";
$dbPassword = "database_password_value";
$dbName = "database_name";
$charset = "utf8mb4";
$port = "3306";
$pdoAttrDefaultFetchMode = \PDO::FETCH_ASSOC; //\PDO::FETCH_ASSOC or \PDO::FETCH_OBJ

$pdoConn = new PDOLight($dbHost, $dbUsername, $dbPassword, $dbName, $charset, $port, $pdoAttrDefaultFetchMode);

$query = "SELECT * FROM `table_name`";
$values_array = array();

$queryResult = $pdoConn->executeQuery($query, $values_array, "selectMultiple");
	

$query = "SELECT * FROM `table_name`";
$values_array = array();

$preparedQuery = $pdoConn->prepareQuery($query);
	
$queryResult = $pdoConn->runPreparedQuery($preparedQuery, $values_array, "selectMultiple");