不知道为什么,控制器中代码已写好,但是通过index调用的时候出现了错误
dbcontroller.class.php文件代码:
class dbcontroller{
function connect(){
$db = new dbmodel();
$db->get();
}
}
?>
index.php文件代码:
require_once("./config.php");
require_once("./libs/controls/dbcontroller.class.php");
require_once("./libs/models/dbmodel.class.php");
require_once("./libs/views/dbview.class.php");
$db = new dbcontroller();
$db -> conncet();
?>
效果图:
定义 function conn ect(){
调用 $db -> conn cet();
太粗心了
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号