MySQL/R33 and mysql_pquery, what is works?
#1

Hi. For example:
Код:
functionTest()
{
 printf("1");
 mysql_pquery(MySQL_Handler, "SELECT * FROM `TableTest`");
 printf("2");
}
Second printf will be done after sending and get data from `TableTest`? Or it query is in queue and it is possible that after that line there wont be data from table?
Reply
#2

Quote:

The difference between this native and mysql_tquery() is, that this type of query uses multi-threading, thus it's faster depending on how many connections are used. The number of connections can be specified in mysql_connect() through the pool_size parameter. Each connection resembles a thread.

From the wiki.

Basically, what will happen is that it will print 1 then print 2, after that the query will be done due to delay.

If you'd like to actually print it after it is finished, this is how:

pawn Код:
functionTest()
{
    print("1");
    mysql_pquery(MySQL_Handler, "SELECT * FROM `TableTest`", "QueryFinished");
}
forward QueryFinished();
public QueryFinished()
{
    print("2");
}
P.S: There's no need to printf when you can simply print.
Reply
#3

Function that is runned from mysql_pquerry, as You wrote this, must be public and forward? Or can be simpli writen:
Код:
QueryFinished()
{
  print("2");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)