PHP code example of jaypha / mysqli-ext

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

    

jaypha / mysqli-ext example snippets


$row = $db->queryRow("select * from sometable where id='2'");  
print_r($row);

$data = $db->queryData("select * from sometable");  
foreach ($data as $row) { ... }

// insert into sometable set id=1, name='john'  
$id = $db->insert("sometable", [ "id" => 1, "name" => "john" ]);  
echo "new row ID is $id";

// insert into sometable (id,name) values (1,'john')"  
$db->insert("sometable", [ "id", "name"], [1, "john"]);

// insert into sometable (id,name) values (1,'john'), (2,'jane')  
$db->insert("sometable", [ "id", "name"], [[1, "john"], [2, "jane"]]);

$row = $db->get("sometable", id);  
assert(is_array($row));

$mysql = new MySQLiExt(...);  
$result = new MySQLiChunkedResult($mysql, $query, $limit);  
foreach ($result as $row) { ... }  

$mysql = new MySQLiExt(...);  
$result = $mysql->queryChunkedData($query, $limit);
foreach ($result as $row) { ... }