MySQL query crashes my server
#1

Hey there! I have one small problem with my query for saving businesses.
When OnGamemodeInit gets called, it loads all businesses and everything works perfectly. But when OnGamemodeExit gets called, it tries to save the businesses and the server crashes.
Here is my saving function:
pawn Код:
SaveBusinesses()
{
    new query[256];
    for(new i; i < MAX_BIZ; i++)
    {
        if(BizInfo[i][Created] == false)
            continue;
           
        mysql_format(mysql, query, sizeof(query), "UPDATE `businesses` SET `Type`='%d', `Owner`='%e', `Name`='%e', `Locked`='%d', `X`='%.2f' WHERE `ID`='%d'",\
        BizInfo[i][Type], BizInfo[i][Owner], BizInfo[i][Name], BizInfo[i][Locked], BizInfo[i][Position][0], BizInfo[i][ID]);
        mysql_tquery(mysql, query, "", "");
       
        mysql_format(mysql, query, sizeof(query), "UPDATE `businesses` SET `Y`='%.2f', `Z`='%.2f', `Price`='%d' WHERE `ID`='%d'",\
        BizInfo[i][Position][1], BizInfo[i][Position][2], BizInfo[i][Price], BizInfo[i][ID]);
        mysql_tquery(mysql, query, "", "");
    }
    return 1;
}
Am I doing something wrong in those formats?
Oh, and here's the mysql log:
pawn Код:
[13:54:21] [DEBUG] mysql_format - connection: 1, len: 256, format: "UPDATE `businesses` SET `Type`='%d', `Owner`='%e', `Name`='%e', `Locked`='%d', `X`='%.2f' WHERE `ID`='%d'"
[13:54:21] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `businesses` SET `Type`='0', `Owner`='The State', `Name`=", callback: "(null)", format: "(null)"
[13:54:21] [DEBUG] mysql_format - connection: 1, len: 256, format: "UPDATE `businesses` SET `Y`='%.2f', `Z`='%.2f', `Price`='%d' WHERE `ID`='%d'"
[13:54:21] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `businesses` SET `Y`='-1722.94', `Z`='13.54', `Price`='42", callback: "(null)", format: "(null)"
[13:54:21] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[13:54:21] [DEBUG] CMySQLConnection::Disconnect - connection was closed
[13:54:21] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 39.945 milliseconds
[13:54:21] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
It looks like database disconnects before the queries are over and I have no idea is it suppose to be like that.
Thank you!
Reply


Messages In This Thread
MySQL query crashes my server - by dominik523 - 09.05.2015, 11:59
Re: MySQL query crashes my server - by Luis- - 09.05.2015, 12:00
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 12:09
Re: MySQL query crashes my server - by Luis- - 09.05.2015, 12:10
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 12:22
Re: MySQL query crashes my server - by Konstantinos - 09.05.2015, 12:25
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 12:51
Re: MySQL query crashes my server - by Konstantinos - 09.05.2015, 13:45
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 13:53
Re: MySQL query crashes my server - by Konstantinos - 09.05.2015, 13:59
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 14:04
Re: MySQL query crashes my server - by Konstantinos - 09.05.2015, 14:17
Re: MySQL query crashes my server - by PowerPC603 - 09.05.2015, 15:34
Re: MySQL query crashes my server - by dominik523 - 09.05.2015, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)