View Single Post
Old 06-27-2008, 10:31 PM   #1 (permalink)
mfolnovich
The Visitor
 
Join Date: Jun 2008
Location: Zagreb, Croatia
Posts: 4
Thanks: 3
mfolnovich is on a distinguished road
Default getting position

So, I have mysql table users:
ID name score

and when getting position of user 'abc', I use:
Code:
$q = select * from users order by score; 
$o = mysql_query($q);
for($i=0;$r=@mysql_fetch_assoc($o);++$i)
    if ($r["name"] == $username) return true;
my question is how can I optimize it, I might have thousands of users ...
Send a message via ICQ to mfolnovich Send a message via AIM to mfolnovich Send a message via MSN to mfolnovich Send a message via Yahoo to mfolnovich
mfolnovich is offline  
Reply With Quote