mysql_GetString -> 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_GetString -> problem (
/showthread.php?tid=447779)
mysql_GetString -> problem -
Leenert - 01.07.2013
Hey everyone.
Everytime when I user the mysql_GetString function, there is a % at the end of the string, that should not be there.
Example: In my database there is a text field, utf8_swdish_ci with "Test". When I select this string via mysql_GetString the function returns "Test%".
Here is my function....
Код:
stock mysql_GetString(Table[], Field[], Where[], Is[])
{
new query[128], Get[128];
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Is, Is);
format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
mysql_query(query);
mysql_store_result();
mysql_fetch_row(Get);
return Get;
}
Maybe there is a mistake in my database?
/edit: The string is saved correctly - so in my database I have the field "Test", not "Test%"
AW: mysql_GetString -> problem -
Leenert - 01.07.2013
Problem solved