如何在null上解析query()?

时间:2019-07-06 14:58:33

标签: php

我无法解决此错误,无法连接到仪表板。

我不知道我在哪里犯了错误。该代码具有MVC结构。

        // Admin.php (model)
        public function getPseudo()
        {
         $sql = "SELECT admin_pseudo FROM t_admin WHERE id=1";
         $login = $this->executeRequest($sql);
         return $login;
        }

        public function getMail()
        {
          $sql = "SELECT admin_mail FROM t_admin WHERE id=1";
          $email = $this->executeRequest($sql);
          return $email;
        }


        public function getPassword()
        {
          $sql = "SELECT admin_password FROM t_admin WHERE id=1";
          $mdp = $this->executeRequest($sql);
          return $mdp;
        } 
        // Modele.php (model)
        abstract class Modele
        {
            private $bdd;

            protected function executeRequest($sql, $params = null){
            if ($params == null){
                $result = $this->getDB()->query($sql); // the error is here !
            }
            elseif ...
        }

0 个答案:

没有答案