=? Operator


in CUserIdentity->authenticate() , we have find(‘LOWER(username)=?’,…

I never see =? operator before , what is it ??

The ? is a placeholder in this case. It’ll be replaced by the user’s name.


If we have multiple ? for example

find('username=? and email=?',array('myUserName','myPassword'))

first ? replaced by myUserName and second replaced by myPassword , right ?



yes right, but you could use better that one

find('username=:u and email=:e',array(':u'=>'myUserName',':e'=>'myPassword'))

Now don’t worry about the order of settings! ;)

Yes I know this place holder : , ? is new for me