Simple Question
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
i found this

Quote:

Description:
Allows you to format a string which you can safely use in a query.

and this

pawn Код:
new query[128];
mysql_format(MySQL, query, sizeof(query), "SELECT * FROM `%s` WHERE `bar` = '%e' AND `foobar` = '%f' LIMIT %d", "foobar", "escape'me\"please", 1.2345, 1337);
// the variable 'query' contains now the formatted query (including the escaped string)
mysql_tquery(MySQL, query, "OnStuffSelected", "");
on the mysql_escape_string

Quote:

Always use this function (if you don't use mysql_format() with the '%e' specifier) before inserting user inputs in a query. You can be victim of a SQL injection if you do not do so.

it's mean that mysql_format is much safer than traditional format?
is that true?
Reply


Messages In This Thread
Simple Question - by AiRaLoKa - 23.05.2014, 02:11
Re: Simple Question - by nmader - 23.05.2014, 02:26
Re: Simple Question - by Trynda - 23.05.2014, 02:30
Re: Simple Question - by nmader - 23.05.2014, 02:33
Re: Simple Question - by AiRaLoKa - 23.05.2014, 02:52
Re: Simple Question - by Konstantinos - 23.05.2014, 09:21
Re: Simple Question - by AiRaLoKa - 23.05.2014, 12:17
Re: Simple Question - by Konstantinos - 23.05.2014, 12:33
Re: Simple Question - by AiRaLoKa - 23.05.2014, 12:40

Forum Jump:


Users browsing this thread: 1 Guest(s)