Hello friends, I have a problem… In my project I want to use two I’d,one is current user I’d which is


And other I’d is any other user in my database… Can anybody give any idea to how to use other id…????

Resultant sql query should be

"select user_I’d, guest_id from table xx where user_I’d=Yii :app()->user->id and

   guest_id =any other user???"

You may get any random record from user table and use the id of that row for random record may follow

$max = Table::model()->count();

$offset = rand(0,$max);

$model = Table::model()->find(array(‘offset’=>$offset));

provided at

and may add check for valid user returned from model request if not tan recall the user table until you get desired.