format to string question
#1

If i wanna doing a query in mysql, i do this

Quote:

new name[10];
name = "lorigio";
new Query[200];
format(Query, sizeof(Query), "update table set var = '%s'", name);
mysql_query(Query);

And after that i said O.o too lines for one query.

I wanna do it likes this
Quote:

new name[10];
name = "lorigio";
mysql_query(format("update table set var = '%s'", name)); <-- format return a string[]

it is possible?
Reply
#2

https://sampwiki.blast.hk/wiki/MySQL#mysql_format

There you go.
Reply
#3

Quote:

new szDestination[100];
mysql_format(connectionHandle, szDestination, "SELECT * FROM `%s` WHERE `bar` = '%e' AND `foobar` = '%f' LIMIT %d", "foobar", "escape'me\"please", 1.2345, 1337);
// the variable 'szDestination' contains now the formatted query (including the escaped string)
mysql_query(szDestination);

Even this use szDestination[100];
i wanna execute query not store query and then execute it.
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)