Raised This Month: $ Target: $400
 0% 

SQL Stats


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
portocala
Member
Join Date: Jun 2010
Old 06-11-2010 , 02:56   Re: SQL Stats
Reply With Quote #3

Quote:
Originally Posted by Brreaker View Post
I think MySQL can handle it, also, is your server performant enough to handle this ?
Yes. No problems about the server's configurations (CPU, RAM, etc).

Quote:
Originally Posted by unnyquee View Post
Use threaded queries.
Do you mean SQL_ThreadQuery ? I had problems using this. Every map end / start I got errors ([MySQL] Thread worker was unable to start.), so I started code using SQL_PrepareQuery and SQL_Execute which by now works perfectly.

Can you explain the difference between SQL_ThreadQuery and SQL_PrepareQuery+SQL_Execute ? Honestly, I have searched but not found anything about it.

Quote:
Originally Posted by fang View Post
Try psychostats?
I used Psychostats, but now I haven't an external server to perform the log processing, so I thought to build my own way to get these information on my website.



Thanks for the replies!


Edited:

If I have this:

Code:
new Handle:Query;

public event_death() {
    new killer = read_data(1);
    new victim = read_data(2);
    new name_killer[32]; get_user_name(killer, name_killer, 31);
    new name_victim[32]; get_user_name(victim, name_victim, 31);
    
    SQL_QuoteString(g_SqlConnection, name_killer, 31, name_killer)
    SQL_QuoteString(g_SqlConnection, name_victim, 31, name_victim)
    
    Query = SQL_PrepareQuery(g_SqlConnection, "SELECT kills FROM %s WHERE name='%s';", table, name_killer)
    SQL_Execute(Query);
    
    if(SQL_NumResults(Query)) {
        new kills = SQL_ReadResult(Query, 0);
        SQL_FreeHandle(Query);
        Query = SQL_PrepareQuery(g_SqlConnection, "UPDATE %s SET kills='%d' WHERE name='%s';",table, kills + 1, name_killer) 
        SQL_Execute(Query);
    }
    
    SQL_FreeHandle(Query);
}

What happens when 'double/triple-kill' ? Is it OK for SQL ?

Last edited by portocala; 06-11-2010 at 03:31.
portocala 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 05:20.


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