Mysql - multiple queryes.
#1

Hello,

Is there a problem if i use multiple queryes in one stock? Like this:

format(query,sizeof(query),"HERE COMMAND");
mysql_query(connection,query,false);
format(query,sizeof(query),"HERE COMMAND");
mysql_query(connection,query,false);
format(query,sizeof(query),"HERE COMMAND");
mysql_query(connection,query,false);
format(query,sizeof(query),"HERE COMMAND");
mysql_query(connection,query,false);

I ask if is wrong this, because sometimes my string, "query", isn't cleared before formatting it, and that result a wrong query.
Reply
#2

ZzZz

Pretty much completely wrong...

Example
PHP код:
new g_mysql_handle;
g_mysql_handle mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DATABASE,MYSQL_PASSWORD);
format(querysizeof(query), "Syntax here");
mysql_function_query(g_mysql_handlequerytrue"CALL-BACK-IF-ANY""WHAT TO PASS"); 
Call-back-if-any - If you have a callback.. Put it there... If not
Replace it with ""
WHAT TO PASS..
Example.. PlayerID... "s",playerid
Reply
#3

There is no mysql_function_query in my plugin / include (a_mysql). I use plugin r39-3 from here:
https://github.com/pBlueG/SA-MP-MySQL/releases
wiki: https://sampwiki.blast.hk/wiki/MySQL/R33
Reply
#4

bump
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)