dispaying top 10 players and monthly top 10 players using php mysql -


I am currently working for a highscore system for my sports website. And I have written the code for it. It shows only 1-player when I click on the top URL of the players and I click the URL of the top men's top players then I want to display the top-top players. How to do it. I am trying since 2 days I have been killed at this point. Please note that the code is as follows. For reference, please refer to the input. I need this kind of any idea ..

  & lt ;? Php include_once ("_data.php"); $ Game_name = "test"; $ Db_table = "newhs_" $ GAME_NAME; $ Conn = mysql_connect ($ db_host, $ db_user, $ db_pass); Mysql_select_db ($ db_name, $ conn); // Record of all time ... if ($ command == "name") {$ sql1 = "SELECT id $ db_table ORDER name ASC"; } And {$ sql1 = "select id $ db_table ORDER score by DESC"; } $ Result1 = mysql_query ($ sql1); // Top 10 players .... if ($ 10 top 10 == "name") {$ sql2 = "selection name, score $ db_table ORDER score DESC limit 10"; } And {$ sql2 = "Select ID by $ db_table ORDER score DESC"; } $ Result2 = mysql_query ($ sql2); // Monthly Top 10 Players ..... If ($ mtop10 == "name") {$ sql3 = "Select name, score $ db_table where date (dateinfo) = CURdate ()"; } And {$ sql3 = "$ db_table by the selection id score by the ORDER DESC"; } $ Result3 = mysql_query ($ sql3); If (! $ Flash) {if ($ order == "name") {$ HTM_1 = "& lt; table cellpadding = '0' cellspacing = '0' limit = '0' width =". $ Table_width "& gt;  gt; alignment = center = gt; & lt; td & gt; . $ Table_prop "& lt; tr alignment = center> gt; & lt; th bgcolor = '". $ T_color "'& gt;" . $ T_font "Pause & Lt; / font> gt; & lt; / th & gt; & lt; th bgcolor = '". $ T_color "'& gt;" . $ T_font "name   & lt; th bgcolor = ''. $ T_color" '& gt; ". $ T_FONT"' & Gt; Score & lt; / Font & gt; & Lt; / Th & gt; & Lt; / Tr & gt; ";} and {$ HTM_1 =" & lt; Table cellpadding = '0' field = '0' border = '0' width = ". $ Table_width" & gt; & Lt; Tabs & gt; & Lt; Tr alignment = center> & Lt; Td> ". Table_prop" & lt; Tr alignment = center> & Lt; Th bgcolor = '". $ T_color"' & gt; ". $ T_font" Pause and Lieutenant; / Font & gt; & Lt; / Th & gt; & Lt; Th bgcolor = '". $ T_color"' & gt; ". $ T_font" name & lt; / A & gt; & Lt; / Font & gt; & Lt; / Th & gt; & Lt; Th bgcolor = ''. $ T_color "'& gt;" . $ T_font "Score & lt; / font> & lt; / th> & lt; / tr & gt;"; } "$ HTM_1" echo; } $ Num = 1; Score ($ r = mysql_fetch_object ($ result1)) {$ result = mysql_db_query ($ db_name, "SELECT name, $ db_table WHERE id = '{$ r-> ID});); $ resultair = mysql_fetch_array ($ Result); $ Id = $ resultArre ["id"]; $ name = $ resultArre ["name"]; $ score = $ resultArray ["score"]; if ($ sec == 1) {if ($ Num & lt; = $ sec_size) {$ HTML = "& lt; Tr bgcolor = '"$ M_color"' align = 'center' & gt; & Lt; Td> ". $ M_font $ Num" & lt; / Td> & Lt; Td> ". $ M_font $ name" & lt; / Font & gt; & Lt; / Td> & Lt; Td> ". $ M_font $ Score" & lt; / Font & gt; & Lt; / Td> & Lt; / Tr & gt; "; echo" $ HTML ";}} and {if ($ num & lt; = $ st_size) {// resonance" & amp; Name $ num = $ name and score $ num = $ score "; if ($ Flash == 1) {resonant" and name $ num = $ name and score $ num = $ score ";} Else {echo" & amp; Name $ num = $ name & amp; Score $ num = $ score & amp; Num $ num = $ num and gamename = $ game_name "; $ HTML =" & lt; Tr bgcolor = '"$ M_color"' align = 'center' & gt; & Lt; Td> ". $ M_font $ Num" & lt; / Td> & Lt; Td> ". $ M_font $ name" & lt; / Font & gt; & Lt; / Td> & Lt; Td> ". $ M_font $ Score" & lt; / Font & gt; & Lt; / Td> & Lt; / Tr & gt; "; echo" $ HTML ";} $ Num ++;}}} Mysql_close ($ conn);? & Gt;  

Please consider adding a preview of your database table content, perhaps there is only 1 row in the table?

Quickly, this problem is with you The query may occur, because all the queries are returned after the work and the contents are obtained from the database.

Where the date (dateinfo) = CURdate ()

And by the way, "Monthly Top 10 players "for queries" LIMIT 10 " Add.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -