01.07.2013, 17:43
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....
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%"
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;
}
/edit: The string is saved correctly - so in my database I have the field "Test", not "Test%"

