Raised This Month: $ Target: $400
 0% 

Problem with Varchars


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-16-2010 , 04:35   Re: Problem with Varchars
Reply With Quote #2

It would be strange if it worked. After all you are trying to store string in a single variable. Try this:
PHP Code:
        new count[32], count1[32], count2count3count4count5

        SQL_ReadResult
(Query,0count31)
        
SQL_ReadResult(Query,1count131)
        
count2 SQL_ReadResult(Query,2)
        
count3 SQL_ReadResult(Query,3)
        
count4 SQL_ReadResult(Query,4)
        
count5 SQL_ReadResult(Query,5
and remove that:
PHP Code:
        if(count == 0)
        
count 
About the 2nd problem:
PHP Code:
if(SQL_ReadResult(Query,0) || SQL_ReadResult(Query,0) == 0
will give you the same result as
PHP Code:
if(true
Both of them are wrong anyway. You should change it to:
PHP Code:
if(SQL_MoreResults(Query)) 
Your way of creating toplist is very inefficient.
Why do you send 15 queries to mysql to get the toplist when you could get it with only 1 query?

I would code it this way:
1) Load toplist from mysql and store it in memory on plugin_init
2) Load player stats and store them in memory on client_authorized
3) Update toplist stored in memory when player gains points
4) Display toplist stored in memory when player wants to see toplist
5) Save player stats on client_disconnect
__________________
Impossible is Nothing
Sylwester 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 10:17.


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