1
flameshockey
global variable problem, help with getting array data

This shouldn't be that complicated, but I can't figure it out. I have users with names like "Depaul", "UIC", "Loyola" and Depaul is in a group called "Depaul" and UIC is in a group called "UIC" and so on. I have an sql table with a column called 'team' that has values "Depaul", "UIC", etc with other info in the rows as well. I want a .php file to display the sql table information based on the user's group name matching the 'team' column. Here's the sudo code I have, am I not including something in the beginng of the file? Basically, I just need help getting the groupid number out of the array.

<?php
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/header.php';

?>

// if i know the useridgroup# ahead of time through php //myadmin, set the numbers equal to team names
$Depaul = 4;
$Loyola = 5;
// get userid (global variable...$xoopsUser??)
// get userid's groups (They are numbers in an array )
$groups = $xoopsUser->getGroups();
// select from the array the value of the groups, which im not sure how to do
$team = whatever value returns thats not admin or registered

if ($team == $Depaul) { // Display Depauls schedule
$query = 'SELECT * FROM game_schedule WHERE (team="Depaul") ORDER BY date ASC';
elseif ( $team == $Loyola) //Display Loyola schedule

Login

Who's Online

209 user(s) are online (121 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits