Quote:
Originally Posted by kochifish
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(query, sizeof(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(OnSelectRow, query, client);
}
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!