Just taken over the maintenance of a website and need help

What I’m trying to do is check with the DB that it’s the final round (it has an ID of 7, comp ID of 7 in the DB) Then make up an array of user ID’s who if logged in will only see the final competition in the dropdown.

Any help would be great.

This is what I’ve got so far…

<?php //Loop foreach($rounds as $round) { //Set Dates $start=date('jS F',strtotime($round->start_date)); $end=date('jS F',strtotime($round->end_date)); //Set Selected if($entryRound==$round->rno) { $selected=' selected="selected"'; } else { $selected=''; } //End Loop } $id = array ('22', '40', '83', '75', '124', '151', '193', '176', '209', '221'); if(in_array($loggedinID,$id)) { //Set HTML $roundHtml.='Round '.$round->rno.' ('.$start.' - '.$end.')'; }; ?>

[quote author=marcb link=topic=25872.msg94427#msg94427 date=1463576417]
What I’m trying to do is check with the DB that it’s the final round (it has an ID of 7, comp ID of 7 in the DB) Then make up an array of user ID’s who if logged in will only see the final competition in the dropdown.

Any help would be great.

This is what I’ve got so far…

[php]
//Loop
foreach($rounds as $round) {

//Set Dates
$start=date(‘jS F’,strtotime($round->start_date));
$end=date(‘jS F’,strtotime($round->end_date));

//Set Selected
if($entryRound==$round->rno) { $selected=’ selected=“selected”’; } else { $selected=’’; }

//End Loop
}

$id = array (‘22’, ‘40’, ‘83’, ‘75’, ‘124’, ‘151’, ‘193’, ‘176’, ‘209’, ‘221’);

if(in_array($loggedinID,$id)) {

//Set HTML
$roundHtml.=’<option value="’.$round->rno.’"’.$selected.’>Round ‘.$round->rno.’ (’.$start.’ - ‘.$end.’)’;
};

[/php]

WHere does the id array come from? I know you are hardcoding it now, but where does it originate?

Sponsor our Newsletter | Privacy Policy | Terms of Service