1
I have a "matchmaking" script (like a game). He checks every 3 seconds a table, to see if there are 10 players who are not playing. Only that I also need to check if among these 10 players, one of them is me.
The select is like this
$busca_db_qtd = mysqli_query($conexao, "SELECT ativo, gamemode, playing, id_user FROM users_buscando WHERE ativo = '1' and gamemode = '$gamemode' and playing = '0' and reservados = '0' LIMIT 10");
I need to check these 10 players, one of them has my id. How can I do this, without having to do a while in php and use a lot of processing (I think it uses right) ?
Iterating 10 records does not seem to be something that will use a lot of processing. The player sending the query himself should not appear in this result? If yes, you can restrict the query by doing
id_user!=$id
, for example.– João Pedro Henrique
That’s what I did, Joao; :)
– Vitor Leite