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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.