SA-MP Forums Archive
MySQL query passing problem. - 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 passing problem. (/showthread.php?tid=436304)



MySQL query passing problem. - BaubaS - 10.05.2013

Why the correct values (for example PaskutinisIsemimas - 2012-05-11 01:54:23) not being shown, but %e instead? And because of that the row I want to update is not being updated.

pawn Код:
mysql_format(Handle, saveData, "UPDATE `zaidejai` SET `SukurimoData` = '%e', `PaskutinisIsemimas` = '%e', `IsvisoPadeta` = '%d', `LygioTaskai` = '%d' WHERE `Vardas` = '%e'", pInfo[playerid][statsRegistrationDate], pInfo[playerid][statsLastWithdrawDate], pInfo[playerid][statsTotalMoneyInBank], pInfo[playerid][statsLevelPoints], GetPlayerNameEx(playerid));
    mysql_function_query(Handle, saveData, false, "", "");
Quote:

[01:51:17] ProcessQueryThread() - Query was successful. (UPDATE `zaidejai` SET `SukurimoData` = '%e', `PaskutinisIsemimas` = '%e', `IsvisoPadeta` = '0', `LygioTaskai` = '110' WHERE `Vardas` = '%e')
[01:51:17] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()

In other queries, its okay. (code is totally the same)

Quote:
Quote:

[01:51:17] ProcessQueryThread() - Query was successful. (UPDATE `zaidejai` SET `Slaptazodis` = 'x', `Email` = 'dafuqtest@inbox.lt' <...>




Re: MySQL query passing problem. - Vince - 10.05.2013

I'm not aware of the bug with mysql_format being fixed. You should stick with normal format and mysql_real_escape_string.


Re: MySQL query passing problem. - BaubaS - 10.05.2013

Dayumn, so lazy to convert mysql_format to normal format function ;\ Going to try ****** code version one.


Re: MySQL query passing problem. - BaubaS - 10.05.2013

Looks like even the ****** code plugin version developers are using format :>

Will this function

pawn Код:
function mysql_real_escape_stringex(str[])
{
    new escapedString[64];
    mysql_real_escape_string(str, escapedString);
    return escapedString;
}
work, when it'll be used something like

pawn Код:
mysql_real_escape_stringex(player_name)
?


Re: MySQL query passing problem. - BaubaS - 11.05.2013

Up. xd