db.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Database\Eloquent\Model;
  3. use Illuminate\Support\Facades\DB;
  4. //$mysql_conf = array(
  5. // 'host' => '192.168.44.128',
  6. // 'port' => '3306',
  7. // 'db' => 'repair_lite',
  8. // 'db_user' => 'root',
  9. // 'db_pwd' => '123456',
  10. //);
  11. //$mysql_conn = @mysqli_connect($mysql_conf['host'], $mysql_conf['db_user'], $mysql_conf['db_pwd'], $mysql_conf['db'], $mysql_conf['port']);
  12. ////$mysql_conn = new mysqli($mysql_conf['host'], $mysql_conf['db_user'], $mysql_conf['db_pwd'], $mysql_conf['db'], $mysql_conf['port']);
  13. //if (!$mysql_conn) {
  14. // die("could not connect to the database:\n" . $mysql_conn->error);//诊断连接错误
  15. //}
  16. //
  17. //$status = $mysql_conn->get_connection_stats();
  18. ////print (json_encode($status));
  19. //
  20. //$result = $mysql_conn->query('select * from permission;');
  21. //print ($result->num_rows);
  22. //$mysql_conn::select("select * from vipinfo");
  23. //var_dump($student);
  24. ////以节点树的形式输出结果
  25. //dd($student);
  26. class H_User extends Model
  27. {
  28. protected $table = 'Models';
  29. }
  30. //
  31. //$students=User::all();
  32. //dd($students);
  33. //DB::select('select * from user');