17.07.2007, 19:18
Quote:
Originally Posted by [RAZ
ADreNaLiNe-DJ ]
Quote:
|
anyway, heres a little function I made to add slashs to characters in a string
So AddSlashs("i ' abc ' lol'",'\'') would return i \' abc \' lol\'
this is to stop mysql errors when putting a player entered strings into a mysql query
pawn Code:
AddSlashs(s[],c)
{
new string[STR];
for(new i = 0, j = strlen(s); i < j; i++)
{
if(s[i] == c)
{
string[i] = '\\';
i++;
string[i] = c;
j++;
} else string[i] = s[i];
}
return string;
}