PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 24, 2017 6:09 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Mar 04, 2014 3:53 am 
Offline
Forum Newbie

Joined: Tue Mar 04, 2014 12:23 am
Posts: 3
Quote:
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"));


Top
 Profile  
 
PostPosted: Tue Mar 04, 2014 11:06 am 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13447
Location: New York, NY, US
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)


Top
 Profile  
 
PostPosted: Tue Mar 04, 2014 2:28 pm 
Offline
Forum Newbie

Joined: Tue Mar 04, 2014 12:23 am
Posts: 3
My using PDO


Top
 Profile  
 
PostPosted: Tue Mar 04, 2014 3:26 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13447
Location: New York, NY, US
So does AOG_single() pass the array of parameters correctly to PDO?

_________________
(#10850)


Top
 Profile  
 
PostPosted: Tue Mar 04, 2014 6:40 pm 
Offline
Forum Newbie

Joined: Tue Mar 04, 2014 12:23 am
Posts: 3
Yes it pass parameter correctly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group