PHP code example of xhxhx / mypro

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

    

xhxhx / mypro example snippets


 DB::table('class as c')
        ->select('c.name as class_name', 's.name as student_name', 's.age', 's.sex')
        ->leftJoin('relation_class_students as r', 'r.class_id', '=', 'c.id')
        ->leftJoin('students as s', 'r.student_id', '=', 's.id')
        ->where('c.grade', 1)
        ->where('c.class', 1)
        ->get();

    DB::table('class')
        ->where('grade', 2)
        ->where('class', 1)
        ->update([
            'teach' => '李老师',
        ]);

    DB::table('class')
        ->insert([
            'grade' => 3,
            'class' => 1,
            'name'  => '三年1班'
            'teach' => '李老师',
        ]);