PHP code example of steinhaug / mysqli

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

    

steinhaug / mysqli example snippets




Mysqli2::isDev(true); // dev: SQL in exception messages. Leave out in production.
Mysqli2::setErrorHandler(function ($error, $query, $errno) {
    error_log("Mysqli2 [$errno] $error | $query");
});
$mysqli = Mysqli2::getInstance($mysql_host, $mysql_port, $mysql_user, $mysql_password, $mysql_database);
$mysqli->set_charset('utf8mb4');
Mysqli2::setPrefix($sw_dp); // optional: table prefix for t(), insert(), update(), count(), exists()