https://s2.ax1x.com/2019/01/21/kieecn.png https://s2.ax1x.com/2019/01/21/kieZ1s.png
class connectModel 单例数据库连接类 public static function getInstance() 来初始化自身
class baseModel 普通数据库操作
$conn = connectModel::getInstance();
$stmt = $conn->prepare("SELECT id,title,sname,hp from menu where st = 1 order by sort
asc");
错误提示: Fatal error: Uncaught Error: Call to undefined method connectModel::prepare()
目的是很多实例化类中, 使用单例数据库连接, 避免数据库多次连接