Hi, am really having hard time with this active record, can someone tell me how to convert this
SELECT ID FROM tablename WHERE EmailAddress = $var
I tested
$criteria = new CDbCriteria;
$criteria->select = 'ID';
$criteria->condition = 'EmailAddress=:email';
$criteria->params = array(':email'=>"test@gmail.com");
print_r(Wsmembers::model()->find($criteria));
that code outputs a bunch of array,because of the print_r
and I can’t echo out an object because it’s not a string.
so how will I get only the exact value of the ID based from the params given?