Php Error - Unexpected require_once expecting function

后端 未结 4 1857
后悔当初
后悔当初 2021-01-16 11:50

I\'m currently trying to fetch the medoo framework so that I can begin easily retrieving data from my MySQL database... and for some reason it doesn\'t work!

here\'s

4条回答
  •  长发绾君心
    2021-01-16 12:34

    You can't have require_once inside a class without a function. That's the main reason.

    Try putting the require_once in the construct.

    To be exact :

    class foo 
    {
        require_once('bar.php');
    }
    

    will throw an error.

提交回复
热议问题