PHP code example of masterpis / db2as400

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

    

masterpis / db2as400 example snippets


 
namespace App;
use Masterpis\Db2as400\Model;

class Employee extends Model{
    protected $table ="oplenhp.employee";
    protected $fields= ["id", "name", "phone"];
    
    public function __construct(){
        parent::__construct();
    }                        
}

 

namespace App\Http\Controllers;

use App\Employee;
use Laravel\Lumen\Routing\Controller as BaseController;

class TestController extends BaseController{

    public function get()
    {
        $mmusid = new Employee;
        $mmusid->where(['id'=>'1']);
        $a=$mmusid->first();
        dd($a)
    }

}