Time : 08:52:05
SQLSTATE[HY093]: Invalid parameter number
Raw SQL : SELECT COUNT(*) FROM `AOG_friends` WHERE ((`A_mid` = :id AND `A_to` = :to) OR (`A_mid` = :to AND `A_to` = :id)) AND `A_accepted` = 'yes'
Added after 3 minutes:
Real codes/script part
$AOG_re = $this->AOG_db->AOG_single("SELECT COUNT(*) FROM `AOG_friends` WHERE ((`A_mid` = :id AND `A_to` = :to) OR (`A_mid` = :to AND `A_to` = :id)) AND `A_accepted` = 'yes'", array('id'=>"$AOG_mid", 'to'=>"$AOG_to"));
pls help me fix sql error
Moderator: General Moderators
pls help me fix sql error
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: pls help me fix sql error
What database extension are you using? I suspect that :id and :to are not being set correctly, but I don't know what $this->AOG_db->AOG_single() does.
(#10850)
Re: pls help me fix sql error
My using PDO
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: pls help me fix sql error
So does AOG_single() pass the array of parameters correctly to PDO?
(#10850)
Re: pls help me fix sql error
Yes it pass parameter correctly