Home  >  Article  >  Backend Development  >  PHP对象调用函数失败解决思路

PHP对象调用函数失败解决思路

WBOY
WBOYOriginal
2016-06-13 12:26:251294browse

PHP对象调用函数失败
不知道为什么,控制器中代码已写好,但是通过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 connect(){
调用 $db -> conncet();

太粗心了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn