Jump to content

USER POSITIOn


crashmaster

Recommended Posts

Hi there,

 

and one more question.

 

user system. Database: user_id (auto_incr) , position

 

When user register his profiles => in database inserting the same values for position as for user_id

 

When somebody search user => script show profiles ORDER BY position DESC

 

If somebody want to "go up" he could pay, and then his position will be : MAX(position) + 1

 

How can I earn from database actual user position.. ??

 

I can do it with :

 

$q =  mysql_query("SELECT * FROM user ORDER BY position DESC");

$i = 0;

while ( $z = mysql_fetch_array($q) ) {

   if ($_SESSION['user_id'] == $z['user_id']) {
          echo 'MY POSITION IS:' . $i ;
  }

$i++;

}

 

 

But I think it will kill my database when about 20 000 users will be online, and total user count will be bout 100 000 ....

 

Does anyone have any idea for a "lighter" script ???

Link to comment
https://forums.phpfreaks.com/topic/84350-user-position/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.