this does retrieve the records, now I want to pass that data to a view and display some of it in a div, the usernames specifically. I’m trying to pass the data like this
Thanks twisted 1919. Here’s my problem though, the statement $everyone_in_the_room = User::model()->findAll(‘LOWER(room_name)=?’, array($_SESSION[‘roomName’])); returns a huge object with a crap load of metadata and I can’t get to the value I need. The user model is just this
user_id
username
has_voted
can_vote
room_name
is_moderator
How do I get at the values I need, am I making sense?
OK here’s another question, how do I make a CHtml link only visible to certain users. What I need is to make a link visible based on a certain value in the current users table in the db if you get me. As the post above shows, the user table has a is_moderator field. I need to check that value of the currently logged in user and set the link to be visible or not. Does that make sense? Appreciate all the input from everyone by the way, this forum’s been a great help.
Thanks waitforit, that worked a charm. As for the data being stored in a session, I assume you’re referring to the $_SESSION[‘roomName’] piece of code. The room name is something that would be useful to get at throughout the application, I’m sure there are probably better alternatives but given I’m a novice at php and Yii, that was the only solution I could think of.