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?
Team Roster
Started by c1rca, Dec 13 2007 08:32 AM
2 replies to this topic
#1
Posted 13 December 2007 - 08:32 AM
#2
Posted 13 December 2007 - 04:57 PM
This can be controlled with a simple sql query:
Hope this helps.
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
Posted 13 December 2007 - 07:36 PM
Lucias O`Neil, on Dec 13 2007, 09:57 PM, said:
This can be controlled with a simple sql query:
Hope this helps.
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
