Reputation: 223
How build this query with YIi query builder
SELECT First_Name,User_ID,
FROM `Users`
WHERE First_name LIKE $_GET['name']
Upvotes: 1
Views: 5238
Reputation: 1
$cr = new CDbCriteria();
$cr->condition = "First_name LIKE '%:name%'";
$cr->params = array(':name'=>$_GET['name']);
$users = Users::model()->findAll($cr);
Another way
Upvotes: 0