SA-MP Forums Archive
MySQL Query error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Query error (/showthread.php?tid=532482)



MySQL Query error - MattTucker - 18.08.2014

I was working on a scratch project, a CnR running with MySQL R5 perfectly fine but then I had to leave it for a while.

So I came back to it yesterday and found this weird bug thing with saving/loading (though as I remember before I leave it, it was perfectly fine)

Queries are not executed for some reason, but the connection to MySQL is working.

pawn Код:
CMD:test(playerid,params[])
{
    new str[128];
    format(str,sizeof(str), "SELECT `ID` FROM `accounts` WHERE `name`='%s'", GetNameEx(playerid));
    if(mysql_query(str))
    {
        SendClientMessage(playerid, -1, "Mysql query was successfully sent");
    }
    else
    {
        SendClientMessage(playerid, -1, "MySQL query failed.");
        if(mysql_ping()) SendClientMessage(playerid, -1, "MySQL connection is alive.");
        if(!mysql_ping()) SendClientMessage(playerid, -1, "Connection to the MySQL Database is dead.");
        return 1;
    }
    return 1;
}
Command I used for testing, I even executed it in the phpmyadmin query and it worked fine. (Replacing %s with a name)

I tried downloading R6 instead of R5, compiled with new version, running with new plugin, and still same error.

Any help would be appreciated.


Note: All queries are not being executed not only that one, stuff like saving/loading players, saving/loading business-es, atms, etc.


EDIT:
pawn Код:
#define host "localhost"
#define user ""
#define pass ""
#define database "testing"



Re: MySQL Query error - Siralos - 18.08.2014

Are you using this one?

https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_query


Re: MySQL Query error - MattTucker - 18.08.2014

No I never added that one in my gamemode before.. However, my gamemode isn't using the cached mysql plugins. (R7+)


Re: MySQL Query error - DobbysGamertag - 18.08.2014

mysql_debug(); use it