Raised This Month: $51 Target: $400
 12% 

[L4D2] Statistic and Ranking System (SRS) [v2.5 | 17 March 2022]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
kochifish
Junior Member
Join Date: Feb 2016
Old 10-23-2022 , 21:58   Re: [L4D2] Statistic and Ranking System (SRS) [v2.5 | 17 March 2022]
Reply With Quote #10

Quote:
Originally Posted by kochifish View Post
hello, ive tried change the database to mysql, but its error, here is my database.cfg:

Tried both version of MySql

- MYSQL 5.7.33
- MYSQL 8.0.30

database.cfg
PHP Code:
    "l4d2_srs"
    
{
        
"driver"            "default"
        "host"                "localhost"
        "database"            "l4d2_srs"
        "user"                "root"
        "pass"                ""
    

Plugins Error:
PHP Code:
L 10/23/2022 08:32:01: [l4d2_srs.smx] [CREATE]: Failed to Create SRS table"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('now','localtime')),LastUpdatedDate DATE DEFAULT (datetime('now','localtime')),' at line 1"
L 10/23/2022 08:32:11: [l4d2_srs.smx] [LOAD]: Failed to load TOP10"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Rank , * FROM SRS LIMIT 0,10' at line 1" 
Could you help me? Thank you!
Ok this one is fixed, i change the database ddriver to another, then i update the SQL query in plugin source, because sqlite and mysql have some difference, but now i only have one problem with this one query:


PHP Code:
case DBA_LOAD:
            {
                
Format(querysizeof(query), "SELECT * FROM (SELECT RANK() OVER (ORDER BY t.Score DESC, t.CreatedDate DESC) AS `globalRank` FROM (SELECT * from l4d2_srs.srs GROUP BY steamId) AS t) AS `rt` WHERE rt.globalRank = '%s'"steamId);
                
g_db.Query(OnSelectRowqueryclient);
            } 
Could you please help me to convert that query syntax to mysql 8 syntax? i tried but no success, im not an expert with sql. Thank you!
kochifish 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 11:57.


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