Raised This Month: $ Target: $400
 0% 

Display multiline and multirow SQLQuery with show_modt


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
the_mm
New Member
Join Date: May 2007
Old 05-02-2007 , 11:27   Display multiline and multirow SQLQuery with show_modt
Reply With Quote #1

Hi comunity!
I have this Problem:
I have a SQL-DB which handles my top15-Players and I want fetch the top15-Data and display it whitch show_modt (like the statsx /top15)

Here is what I coded till now:

Code:
//Connect to the DB
 SQL_Connect(g_SqlTuple,ErrorCode,g_Error,511)
   if(g_SqlTuple == Empty_Handle)
new Handle:Query = SQL_PrepareQuery(SqlConnection,"SELECT a.name, b.rank, c.kills, c.deaths, c.hits, c.shots, c.headshotkills, c.accuracy FROM ps_plr_ids a, ps_plr b, ps_c_plr_data c WHERE b.rank <=15 AND b.rank !=0 AND a.plrid=b.plrid AND b.plrid=c.plrid GROUP BY rank ORDER BY b.rank ASC;")
        run the query
    if(!SQL_Execute(Query))
    {
SQL_QueryError(Query,g_Error,511)
set_fail_state(g_Error)
}
   
    fputc(top15, '^n');
    fprintf(top15,"BLAAAA")
    new plnick[21]
    SQL_ReadResult(Query,0,plnick,20)
    new plrank = SQL_ReadResult(Query,1)
    new plkills = SQL_ReadResult(Query,2)
    new pldeaths = SQL_ReadResult(Query,3)
    new plhits = SQL_ReadResult(Query,4)
    new plshots = SQL_ReadResult(Query,5)
    new plheadshots = SQL_ReadResult(Query,6)
    new Float:placc
    SQL_ReadResult(Query,7,placc)
    new Float:pleff = (100 * float(plkills) / (float(plkills) + float(pldeaths)))
 %.2f",plrank, plnick, pldeaths, plhits, plshots, plheadshots, pleff, placc)
the_mm is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode