Jump to content


Team Roster


2 replies to this topic

#1 c1rca

    Young Padawan

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Stourbridge
  • Interests:Skateboarding, Music, Gaming

Posted 13 December 2007 - 08:32 AM

Basically, i am making a website for a gaming team that i run and in my user database i have a field called 'css_team' with enum and the fields set as Y and N. Basically, the default is N and the players in my team are set to N.

I am creating a roster panel on the main page and i want it to just show the usernames of the ones with the 'css_team' field value as Y.

Could anyone help me with this?

#2 David Knight

    Young Padawan

  • Members
  • Pip
  • 137 posts
  • Gender:Male
  • Location:Usa, Pa

Posted 13 December 2007 - 04:57 PM

This can be controlled with a simple sql query:
SELECT * FROM users WHERE css_team = 'N'
The full script would look something like this:
<?php
	$query  = "SELECT * FROM users WHERE css_team = 'Y'";
	$result = mysql_query($query);

	while($row = mysql_fetch_array($result)) {
?>
	<b>Name</b> - <?php echo $row['name']; ?>
<?php
	}
?>

Hope this helps.

#3 c1rca

    Young Padawan

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Stourbridge
  • Interests:Skateboarding, Music, Gaming

Posted 13 December 2007 - 07:36 PM

View PostLucias O`Neil, on Dec 13 2007, 09:57 PM, said:

This can be controlled with a simple sql query:
SELECT * FROM users WHERE css_team = 'N'
The full script would look something like this:
<?php
$query = "SELECT * FROM users WHERE css_team = 'Y'";
$result = mysql_query($query);

while($row = mysql_fetch_array($result)) {
?>
<b>Name</b> - <?php echo $row['name']; ?>
<?php
}
?>

Hope this helps.


Thanks, i'll try that out tomorrow.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users