2

I'm fairly new in making own code in concrete5, so I could use some help! :)

I have a reference table with event IDs and user IDs. I would like to fetch the names of all users on a givent event.

I have the two necessary IDs:

UserID: $u->getUserID();
EventID: $c->getCollectionID()

How can I make a loop in a view.php page, that creates a list of all names of the users signed up for an event? The name is in the user attribute "name".

Example: I would like to have the names of the users with user ID 1 and 4, because they have signed up for event 221 (see this image: http://www.tiikoni.com/tis/view/?id=11a89f6).

Expected result on my page: John Doe, Jane Doe

I hope someone can help me.

Jacob
  • 21
  • 1

1 Answers1

0

The image link has expired, as Ortomala replied.

Sounds like you need some custom PHP block code that SELECTs all user ids from the MySQL table that matches the EventID (the current UserID is not relevant).

Here's some example pseudo code:

"SELECT b.UserID, u.uName FROM btYourEventTable AS b, Users as u  
 WHERE EventID = '". $c->getCollectionID(). "' AND b.UserID = u.uID";

If you need help with this, I'm user jasteele12 on concrete5.org