PHP code example of maertien / liteorm

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

    

maertien / liteorm example snippets




// Load LiteORM classes as simple as 
M_DB_FILE", "./test.sqlite");

// Create database structure as simple as
class Man extends LiteORMDataObject {
}
$man = new Man(array("age" => 20, "name" => "Martin"));
$man->createTable();

// Insert object
$man->save();

// Get some property value
echo $man->get("age");

// Modify and save object
$man->set("age", 22);
$man->save();

// For more examples please take a look at tests/test_sqlite.php file