How to compare Mysql queries?

Basically i have this code:

pawn Код:
format(query, sizeof(query), "SELECT `faction` FROM `users` WHERE `name` = '%s'", name);
mysql_function_query(dbHandle, query, false, "", "");
format(query, sizeof(query), "SELECT `faction` FROM `users` WHERE `name` = '%s'", GetName(playerid));
mysql_function_query(dbHandle, query, false, "", "");
How do i compare both of those results, they will return a number from the database, if that helps.

Why the hell do you even need the two queries? You can use OR (WHERE name = x OR name = y). And what do you mean by "compare"?

It's to kick a player from a faction, when he's offline, basically, this compares if both players are in the same faction, if they are the command proceeds to kicking the other player.

The problem is i have no idea how to do that in PAWN, since i'm somewhat new to it.

Instead of two queries you can simply run one query and check if multiple rows are retrieved.

Forum Jump:

Users browsing this thread: 1 Guest(s)