Db.php 634 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Config;
  3. /**
  4. * mysql配置
  5. * @author walkor
  6. */
  7. class Db
  8. {
  9. /**
  10. * 数据库的一个实例配置,则使用时像下面这样使用
  11. * $user_array = Db::instance('user')->select('name,age')->from('users')->where('age>12')->query();
  12. * 等价于
  13. * $user_array = Db::instance('user')->query('SELECT `name`,`age` FROM `users` WHERE `age`>12');
  14. * @var array
  15. */
  16. public static $common = array(
  17. 'host' => '127.0.0.1',
  18. 'port' => '3306',
  19. 'user' => 'root',
  20. 'password' => 'crazy_coin2020',
  21. 'dbname' => '',
  22. 'charset' => 'utf8'
  23. );
  24. }
  25. ?>