1 or 2?
#1

How is the best option?

Option 1:
Код HTML:
public OnPlayerConnect(playerid)
{
    mysql_format(MySQLCon, stmsg[playerid], 150, "SELECT * FROM `bans` WHERE `Player` = '%e' OR `IP` = '%s'", GetNameP(playerid), IPPlayer(playerid)),
    mysql_pquery(MySQLCon, stmsg[playerid], "OnBanCheck", "d", playerid);
    return 1;
}
Option 2:
Код HTML:
public OnPlayerConnect(playerid)
{
    mysql_format(MySQLCon, stmsg[playerid], 150, "SELECT * FROM `bans` WHERE `Player` = '%e' OR `IP` = '%s'", GetNameP(playerid), IPPlayer(playerid)),
    mysql_tquery(MySQLCon, stmsg[playerid], "OnBanCheck", "d", playerid);
    return 1;
}
Reply
#2

http://forum.sa-mp.com/showpost.php?...postcount=5021

Explains it very well.
EDIT: By the way, next time please be more clear about your question.
It took me a minute to find the difference between the two.
Reply
#3

Removed
Reply
#4

Thank you.
In this case it would be much better to use only pquery for all queries in my Gamemode?
Reply
#5

Quote:
Originally Posted by Spenker
Посмотреть сообщение
Thank you.
In this case it would be much better to use only pquery for all queries in my Gamemode?
It depends on what you're doing.
I've been using tqueries since forever and I've never had any problems.

If you want a query to run even if there are other queries running, use pqueries.
If you don't mind them running one after the other, use tqueries.

EDIT: fixed 'the' to 'them'
Reply
#6

Ok, thank you.
Reply
#7

It is worth noting that if you want some queries to be executed in order (like sending a DELETE query and then directly an INSERT query), you shouldn't use mysql_pquery because it's not guarantee that will be executed with the same order they were sent.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It is worth noting that if you want some queries to be executed in order (like sending a DELETE query and then directly an INSERT query), you shouldn't use mysql_pquery because it's not guarantee that will be executed with the same order they were sent.
It would be more beneficial if they use pquery only "SELECT * FROM ..." ?
Reply
#9

Quote:
Originally Posted by Spenker
Посмотреть сообщение
It would be more beneficial if they use pquery only "SELECT * FROM ..." ?
You won't notice much of a difference unless many queries will be sent at once (and still, the time it takes is in milliseconds (at least for a samp server)) - and by difference I'm not referring to the server (both are executed in different thread than the main one)
Reply
#10

Ok, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)