"Where" syntax for multiple choice
If the user is an administrator, then you won't need a where statement as all of the results need returning. I would do something like this:
//If the user is an admin, no where statement is needed as we are returning all results
$where = '';
//Else, find out which teams they should be able to see
//Trim will remove the tab space at the beginning of the list. The team values will be tab separated, explode them into an array
$values = explode("\t",trim($CURRENT_USER['team']));
//implode the values into a comma seperated array
$values = implode(',',$values);
$where = "(team_1 IN($values))";
//The MySQL IN statement will retrieve any rows which appear in the $values list.
list($gamesRecords, $gamesMetaData) = getRecords(array(
'tableName' => 'games',
'loadUploads' => true,
'where' => $where,
'allowSearch' => false,
'perPage' => '18',
This is just test code, so you might need to make a few changes to get it working.
So if the user is an admin, then we set the $where variable to nothing. But if the user is a normal user, we find there team, and get the values from it and store that in the $where string.
The where string is set against the where key in the getRecords function.
Let me know if you have any questions.
PHP Programmer - interactivetools.com