Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - Error in my PDO execute function -


i have following query:

select case when card_type='a'  name else  concat_ws(' ',firstname,lastname)  end                       cname ,cardid,card_type,isdeck,userid_from,status,cards.gibid,message ,userid_to,description,tagline,gibs.preview_thumb                     ,case when  userid_from=userid_to 'my card ' else 'other 'end owner              cards left join gibs on gibs.gibid=cards.gibid                 left join users on users.userid=cards.userid_from             userid_to=? , cards.deleted='n'  , (case when card_type='a'  name else  concat_ws(' ',firstname,lastname)  end)  '%?%'             order status,card_type desc,owner,cname,isdeck desc 

and array passed in execute function :

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

it giving me error ..

warning: pdostatement::execute(): sqlstate[hy093]: invalid parameter number: number of bound variables not match number of tokens in /var/www/ryapi/db.php on line 176  fatal error: uncaught exception 'pdoexception' message 'database error [hy093]: , driver error code ' 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 

why error coming please suggest.

concat_ws(' ',firstname,lastname)  end)  '%?%' 

here, '%?%' not pdo param. should make it:

concat_ws(' ',firstname,lastname)  end)  ? 

then bind:

array (     [0] => 1     [1] => '%rahul%' ) 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -