Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6991133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:27:15+00:00 2026-05-27T19:27:15+00:00

with the following query: $result = mysql_query( SELECT Stats.champion FROM Stats, Games WHERE Stats.game_id

  • 0

with the following query:

$result = mysql_query(
"SELECT Stats.champion
FROM Stats, Games
WHERE Stats.game_id = Games.game_id
AND Stats.win = 1
AND Games.game_mode = 'ODIN'");

I am returned the following dataset:

Ezreal 
Garen 
Pantheon 
Ahri 
Sion 
Rammus 
Nidalee 
Poppy 
Heimerdinger 
Graves 
KogMaw 
Gangplank 
Tristana 
Fizz 
Pantheon 
Pantheon 
Evelynn 
MasterYi 
Tryndamere 
Leona 
Vayne 
Malphite 
Graves 
Shaco 
Nidalee 
Graves 
Heimerdinger 
Gangplank 
JarvanIV 
Akali 

My goal is to count the result for each name. I know for one, for example “Pantheon”, I can do:

$result = mysql_query(
"SELECT Stats.champion
FROM Stats, Games
WHERE Stats.game_id = Games.game_id
AND Stats.champion = 'Pantheon'
AND Stats.win = 1
AND Games.game_mode = 'ODIN'");

$pantheonwins = mysql_num_rows($result);
echo $pantheonwins;

This results with the correct information!

Pantheon 
Pantheon 
Pantheon 
3

So since this gives me the correct data, is this the most efficient way to get the win count for each individual name, then get a total number of records to computer percents?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:27:16+00:00Added an answer on May 27, 2026 at 7:27 pm

    Try changing your query to this:

    SELECT
        Stats.champion,
        count(Stats.champion) as myCount
    FROM
        Stats, Games
    WHERE 
        Stats.game_id = Games.game_id
        AND Stats.win = 1
        AND Games.game_mode = 'ODIN'
    GROUP BY
        Stats.champion
    

    Now, you should get the count along with the champion in the query result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what would be the result of following query? select StudentName from Students where StudentName
Please look the following query: SELECT ID, START, END FROM TABLEA the result is:
I have the following code: (query added) $weight_table = mysql_query (SELECT * FROM .$prefix.weight
Im using the following function. function GetSubmissions($coach){ $result = mysql_query(SELECT * FROM `ptable` WHERE
I have the following MySQL query: SELECT value_1, ( SELECT value_4 FROM table_1 WHERE
I have the following MySQL query: SELECT Project.*, `trk_deleted`, `trk_status`, `trk_state` FROM `project` AS
I have the following sample query (MySQL): SELECT * FROM `action` WHERE `customer_id` IN
Hi i have the following query/table from a local bookstore $queryadmin =SELECT last_name, first_name,
I have the following query: $sql = SET @rownum := 0; SELECT * FROM
I have the following query: select count(L.ID) from LA inner join L on (LA.leadid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.