Invalid parameter number: Fatal ERROR

前端 未结 1 1300
孤独总比滥情好
孤独总比滥情好 2021-01-16 18:19
 /* News Feed Data */
     public function newsFeed()
     {
        $db = getDB();
        $stmt = $db->prepare(\"SELECT user.id as id, user.nome as nome, app.id         


        
相关标签:
1条回答
  • 2021-01-16 18:28

    You have error in the binding. You have :uid in the query but :id in the binding. This should work:

        $stmt = $db->prepare("SELECT app_like.id , reaction.name from app_like, reaction WHERE reaction.id=app_like.reaction_id AND app_like.user_id=:uid  AND app_like.app_id=:id");  
    
        $stmt->execute(array(':uid' => $uid,
                  ':id' => $msg_id));
    
    0 讨论(0)
提交回复
热议问题