[HELP]MySQL
#1

I update the plugin MySQL R9 to R37 and give me these errors when i try to compile the gamemode.

Код:
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2226) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2227) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2228) : error 017: undefined symbol "mysql_fetch_row"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2241) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2242) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2243) : error 017: undefined symbol "mysql_fetch_row"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2254) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2263) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2271) : error 017: undefined symbol "mysql_ping"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2279) : error 017: undefined symbol "mysql_ping"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2304) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2345) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2356) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2357) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2358) : error 017: undefined symbol "mysql_num_rows"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2366) : error 017: undefined symbol "mysql_fetch_row"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2378) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2379) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2380) : error 017: undefined symbol "mysql_num_rows"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2388) : error 017: undefined symbol "mysql_fetch_row"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2398) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2399) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2400) : error 017: undefined symbol "mysql_fetch_row"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2412) : error 035: argument type mismatch (argument 1)
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2413) : error 017: undefined symbol "mysql_store_result"
C:\Users\ScooBy\Downloads\girlshare.ro_sa-zone\server\gamemodes\sa-zone.pwn(2414) : error 017: undefined symbol "mysql_fetch_row"
The lines 2226-2228:
pawn Код:
public MYSQLBANAT(sqlvalname[], sqlresult[])
{
    new query[128];
    format(query, sizeof(query), "SELECT Locked FROM players WHERE Name = %d LIMIT 1", sqlvalname);
    mysql_query(query); // THIS LINE GIVE ERROR
    mysql_store_result(); // THIS LINE GIVE ERROR
    if(mysql_fetch_row(sqlresult)==1) // THIS LINE GIVE ERROR
    {
        return 1;
    }
    return 0;
}
Reply
#2

As it says it is a 'mismatch' as your plugin and includes which the gamemode is compiled with, do not have the same versions needed to work. The includes must be matched to the same version of the MySQL that you are using, as well as with the plugins!
Reply
#3

In the latest versions of the mysql plugin, it's totally different how it works. Function mysql_query can use cache and you should store the result and then delete it (in SELECT). Also the first argument is the connection handle. The functions mysql_store_result and mysql_fetch_row do not exist anymore.

If you're about to use the latest versions (something you should - update to R39 by the way), it's good to use threaded queries.

Tutorial about threaded queries: https://sampforum.blast.hk/showthread.php?tid=337810
Wiki (R33+): https://sampwiki.blast.hk/wiki/MySQL/R33
Example script: https://github.com/pBlueG/SA-MP-MySQ...stem-cache.pwn
Reply


Forum Jump:


Users browsing this thread: