PHP OOP issue with database

前端 未结 3 1955
清歌不尽
清歌不尽 2021-01-26 17:43

I am querying usernames from database using the get() function in the DB class.. its always returning \'No users\' even if there are users existing in the database.. here is my

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 18:08

    In your query function when binding you do:

    foreach ($params as $param) {
        $this->_query->bindValue($x, $params);
        $x++;
    }
    

    You are binding $params which is an array, not the value. Change $params to $param (singular) and it will likely work.

提交回复
热议问题