Jump to content

query 2 sql databases


Davie33

Recommended Posts

i have a ranking code and i would like to know how i can add another $rquery.

$ranking = array();
    $rquery = yasDB_select("SELECT username FROM user ORDER BY plays"); // only way to rank I see is by plays which you can use to count comments/user submissions
    $i=0;
    while ($rank = $rquery->fetch_array(MYSQLI_ASSOC)) {
        $ranking[$i] = $rank['username'];
        $i++;
    }
    $rank = array_search($username,$ranking)+1;

What i mean is this code here is giving a member a rank to how many games they have play.

so say a member played 102 game and the other member played 94.Member one would be rank 1 and 2nd member is rank 2 how do i add another sql to it so it will do the same for this sql ?

 

CREATE TABLE IF NOT EXISTS `topic` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `userid` int(11) NOT NULL DEFAULT '0',

  `ipaddress` varchar(255) NOT NULL DEFAULT '',

  `comment` text NOT NULL,

  `name` varchar(255) NOT NULL DEFAULT '',

  PRIMARY KEY (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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.