PHP code example of ugo / simpleorm
1. Go to this page and download the library: Download ugo/simpleorm 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/ */
ugo / simpleorm example snippets
bObject\DbObject;
$dbcnx = [YOUR DATABASE CONNECTION STRING];
$object = new DbObject($dbcnx);
// to select 2 records from the table userdata
$output = $object->doSelect('userdata')->limit('2')->run();
var_dump($output);
// get all records but just the username and password fields from table userdata
$output = $object->doSelect('userdata',['username','password'])->run();
var_dump($output);
/// insert records to table userdata
$output = $object->doInsert('userdata',['username'=>'[email protected]','password'=>'123456'],[]);
var_dump($output);