Hi, sorry if this post is in the wrong place or anything im new.
i was just wondering is it possible to do a select statement where it only shows data for the user that is logged in?
i havent created anything yet, i was just wondering if this is possible.
i am looking to create a timetable sort of application where a user logs on and all of their classes are shown and only there classes are shown, but also i would like to allow the admin to log and amend any of the dates or times of the classes.
2- when user logged in you need to register user id or username if user name is unique by add it to session or cookie
add as session :
$this->setState(‘id’, $record[‘id’]);
or
$this->setState(‘username’, $record[‘username’]);
then you can call id or username from any controller in your app like
//// get all articles related to loggedin user
if( isset(yii::app()->user->id)){/// if logged in and had id
$id=yii::app()->user->id;
$model=articles::model()->findall("writer_id=$id");
}