Escape
#1

If i do mysql escape and i write it in other variable escape exit's or no?

Код:
new escapestring[ 50 ];

mysql_real_escape_string(escapestring,escapestring);

new otherstring[ 50 ];

format(otherstring,49,"%s", escapestring);
Reply
#2

Yes, it does.
Reply
#3

You mean i don't need to do another escape like:

Код:
format(otherstring,49,"%s", escapestring);

and

mysql_real_escape_string(otherstring,otherstring);
Reply
#4

You should basically only escape inputs.

You're better off leaving that function aside. And when you are going to execute a query that has custom inputs in it, use the %q specifier (escapes the string placed in the parameter), instead of the %s specifier.

The %q specifier is built into the native format.
Reply
#5

But i heard i have to escape everything i write into database update,select,delect queries any collum is text and player can write
Reply
#6

use mysql_format and use %e to escape.
Reply
#7

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
But i heard i have to escape everything i write into database update,select,delect queries any collum is text and player can write
You only have to escape strings that players have inputted/specified.
Reply
#8

Yes, but i don't understand with first question, when i write escaped text in other variable i need reescape again?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)