random string
#1

Hi,

Код:
stock randomString(strDest[], strLen = 10)
{
	while(strLen--)
	{
	    new nntte = random(3);

	    if( nntte == 0 )
	    {
	        nntte = random(26) + 'A';
	    }
	    else if( nntte == 1 )
	    {
	        nntte = random(26) + 'A';
	    }
	    else if( nntte == 2 )
	    {
	        nntte = arraygf[random(sizeof(arraygf))] + '0';
	    }
		strDest[strLen] = nntte;
	}
}
With this function i create random string, and i write it in mysql database i need to escape it?
Reply
#2

Oh for the love of ... Just use %e in mysql_format for whatever text you insert wherever. If it doesn't help it doesn't hurt either.

Reply
#3

Yes i know need to escape, but i just ask for this specific function, do i need?
Reply
#4

Quote:
Originally Posted by Bussyman
Посмотреть сообщение
Yes i know need to escape, but i just ask for this specific function, do i need?
not really, as long as you don't have ; or ' characters.
and as Vince said just use %e to escape, if it won't help it won't hurt either.
Reply
#5

Never trust any input, these may change at any time. Escape everything.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)