$sql = "SELECT teamname,id FROM `aacl_team`";
$result = mysql_query($sql) or die (mysql_error());
I want to do something like this though
SELECT teamname,id FROM `aacl_team` WHERE $laddered is less than or more than $points LIMIT 1
So if $points = 5
I need it fetch out the DB the lowest one after 5 so if team 1 has 4 points and team 2 has 1 points then it will fetch team 1 and the same the other way around for nearest highest but limit it to 1 so I only get 2 teams. Then if something goes wrong like all the lowest teams are 5 can we echo out No Teams.
I tried using the > < signs but I guess they dont work in a query. Sorry for the bad explaination.
$sql = "SELECT teamname,id FROM `aacl_team` WHERE $currentpointsp > $currentpoints LIMIT 1 AND $currentpointsp < $currentpoints LIMIT 1"; $result = mysql_query($sql) or die (mysql_error());
Thats the code I tried. Just a random guess, might give you a better understanding of what I whould like to achieve