05.04.2016, 14:00
(
Последний раз редактировалось Hellman92; 05.04.2016 в 14:39.
)
THis error what i get, maybe you guys are able to slove this.
EDIT: i sloved the problem!
Код:
15:58:01] [ERROR] CMySQLQuery::Execute[OnQueryFinished] - (error #1064) 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 '' at line 1
PHP код:
case THERAD_SHOW_MOTD:
{
for(new i;i < rows;i++)
{
cache_get_field_content(extraid, "gMOTD", GlobalMOTD, g_iHandle);
cache_get_field_content(extraid, "aMOTD", AdminMOTD, g_iHandle);
cache_get_field_content(extraid, "vMOTD", VIPMOTD, g_iHandle);
cache_get_field_content(extraid, "cMOTD", CAMOTD, g_iHandle);
cache_get_field_content(extraid, "pMOTD", pMOTD, g_iHandle);
break;
}
}
PHP код:
stock g_mysql_LoadMOTD()
{
mysql_tquery(g_iHandle, "SELECT `gMOTD`,`aMOTD`,`vMOTD`,`cMOTD`,`pMOTD` FROM `misc`", true, "OnQueryFinished", "iii", THERAD_SHOW_MOTD, INVALID_PLAYER_ID, -1);
}
stock g_mysql_SaveMOTD()
{
new query[1024];
format(query, sizeof(query), "UPDATE `misc` SET ");
format(query, sizeof(query), "%s `gMOTD` = '%s',", query, SQL_ReturnEscaped(GlobalMOTD));
format(query, sizeof(query), "%s `aMOTD` = '%s',", query, SQL_ReturnEscaped(AdminMOTD));
format(query, sizeof(query), "%s `vMOTD` = '%s',", query, SQL_ReturnEscaped(VIPMOTD));
format(query, sizeof(query), "%s `cMOTD` = '%s',", query, SQL_ReturnEscaped(CAMOTD));
format(query, sizeof(query), "%s `pMOTD` = '%s',", query, SQL_ReturnEscaped(pMOTD));
mysql_tquery(g_iHandle, query, "OnQueryFinished", "i", THERAD_SHOW_MOTD);
}
EDIT: i sloved the problem!