search

Home  >  Q&A  >  body text

When I query the database data, an error message appears. How can I solve it?

1. Controller interface

public function demo(){
dump("Test whether the control can be accessed");
$sql = 'SELECT * FROM `user` ';
dump("Test whether the sql statement is wrong");
$res = Db::query($sql);

var_dump($res);

2 , error message

could not find driver



##}

古月胡!古月胡!2013 days ago1574

reply all(1)I'll reply

  • angryTom

    angryTom2019-07-17 16:32:44

    There is no database driver. Are you sure your database link is correct?

    reply
    0
  • Cancelreply