1. Go to this page and download the library: Download hxgf/dbkit 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/ */
$new_id = db::insert("celestial_bodies", [
'name' => 'Luna',
'classification' => 'moon',
'comment' => 'Earth\'s moon, also commonly referred to as "the moon"'
]);
echo $new_id;
$planets = db::find("celestial_bodies", "classification = 'planet' ORDER BY title ASC LIMIT 8");
foreach ($planets['data'] as $p){
echo $p['title'];
echo $p['classification'];
// etc, etc
}
echo $planets['total']; // 8
$space_objects = db::find("", "SELECT title, classification FROM celestial_bodies WHERE id IS NOT NULL", [
'raw' => true
]);
db::update("celestial_bodies", [
'name' => 'Mars',
'comment' => 'Research "The Phobos Incident" -- we are not alone'
], "name='Marz'");