Benim PDO'de Hata işlevini yürütmek

0 Cevap php

Ben aşağıdaki sorgu var:

SELECT case when card_type='A'  then name else  CONCAT_WS(' ',firstname,lastname)  end 
                     as cname ,cardid,card_type,isDeck,userid_from,status,cards.gibid,message ,userid_to,description,tagline,gibs.preview_thumb
                    ,case when  userid_from=userid_to then 'my card ' else 'other 'end as owner 
            FROM cards LEFT JOIN gibs ON gibs.gibid=cards.gibid
                left join users on users.userid=cards.userid_from
            WHERE userid_to=? and cards.deleted='N'  and (case when card_type='A'  then name else  CONCAT_WS(' ',firstname,lastname)  end)  like '%?%'
            order by status,card_type desc,owner,cname,isDeck desc

ve işlevini yürütmek geçti dizidir:

Array
(
    [0] => 1
    [1] => rahul
)

bana hata veriyor ..

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in /var/www/ryapi/Db.php on line 176

Fatal error: Uncaught exception 'PDOException' with message 'Database error [HY093]: , driver error code is ' in /var/www/ryapi/Db.php:179
Stack trace:
#0 /var/www/ryapi/Db.php(93): Db::_query('SELECT case whe...', Array)
#1 /var/www/ryapi/card.php(152): Db::getResult('SELECT case whe...', Array)
#2 /var/www/ryapi/index.php(103): Card->getcardlist('1', '', 'rahul')
#3 {main}
  thrown in /var/www/ryapi/Db.php on line 179

neden bu hata önermek için lütfen geliyor.

0 Cevap