Using wildcards in prepared statement - MySQLi

后端 未结 5 832
无人及你
无人及你 2020-11-27 23:14

I\'m trying to run the following query, and I\'m having trouble with the wildcard.

   function getStudents() {
        global $db;
        $users = array();
         


        
5条回答
  •  粉色の甜心
    2020-11-27 23:58

    Parameter #2 must be a reference, not a value. Try

    $param = '%' . $this->className . '%';
    $query->bind_param('s', $param);
    

提交回复
热议问题