MySQL Query error
#1

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"
Reply
#2

Are you using this one?

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

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

mysql_debug(); use it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)