Yii Framework Forum: What Does =? Do? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

What Does =? Do? User::model()->find('LOWER(username)=?'

#1 User is offline   haosmark 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 27-January 13

Posted 03 February 2013 - 10:57 PM

In the authentication, there's this:
$user = User::model()->find('LOWER(username)=?', array(strtolower($this->username)));

What does =? do in this section: LOWER(username)=?
0

#2 User is offline   Luke Jurgs 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 162
  • Joined: 16-October 11
  • Location:Australia

Posted 04 February 2013 - 04:07 AM

It's an interpolation placeholder, it gets replaced by the contents of strtolower($this->username).

See example 2 here: PHP: Prepared statements and stored procedures

View Posthaosmark, on 03 February 2013 - 10:57 PM, said:

In the authentication, there's this:
$user = User::model()->find('LOWER(username)=?', array(strtolower($this->username)));

What does =? do in this section: LOWER(username)=?

0

#3 User is offline   haosmark 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 27-January 13

Posted 04 February 2013 - 09:22 AM

Thank you.
Seems like it's good feature to take advantage of.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users