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
https://forums.phpfreaks.com/topic/247090-query-2-sql-databases/
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.