Page 1 of 1
Listing members with points
Posted: Mon Mar 01, 2004 9:11 pm
by HaVoC
I'm trying to list players with points. So I'd do this
Code: Select all
<?php
if ($points > 0){
fdgdsfg
}
?>
Easy right? Well here's the tricky bit. When someone loses, they lose 1 point. How do I list people with points, and with negatory points, like -1 and -2?
Posted: Mon Mar 01, 2004 9:23 pm
by redhair
Posted: Mon Mar 01, 2004 9:57 pm
by HaVoC
Uh...what's that? lol
Posted: Tue Mar 02, 2004 6:18 am
by redhair
$points = your variable
- = minus
= = is
2 = is a number
combined, they make the calculation,...
Like this code will add 2 points:
Posted: Tue Mar 02, 2004 4:49 pm
by HaVoC
How does that list players with negatory points? I don't want to take their points away. I've already done that. Some players have a score of -1. How do I make the PHP display that?
Posted: Tue Mar 02, 2004 4:51 pm
by markl999
if ($points < 0){ ??
Posted: Tue Mar 02, 2004 8:41 pm
by HaVoC
Don't worry about it. I'll find out a way. Your way will only show people who have less than 0 points. =/
Posted: Tue Mar 02, 2004 8:44 pm
by tim
correct me if i'm wrong, but:
isnt any number below dead "zero" considered negative?

Posted: Wed Mar 03, 2004 3:45 am
by Dr Evil
If $points exists:
Code: Select all
<?php
if (isset($points)){
fdgdsfg
}
?>
Just make sure people who never played don't have 0 in their $points.
Or you could use:
Code: Select all
<?php
if (($points>0)or($points<0)){
fdgdsfg
}
?>
But people who had their points reduced to 0 won't appear.
Posted: Wed Mar 03, 2004 4:12 am
by twigletmac
If you want to get those with points less than or equal to zero, you can do:
If you want to show everybody with points (positive, 0 or negative), then take out the if statement.
Have a read of:
http://php.net/manual/en/language.opera ... arison.php
Mac