Afficher un message
Vieux 27/09/2007, 22h55   #1
qwertycat@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Is it possible to combine a SELECT and UPDATE in a single query

Is it possible to combine both of these queries into a single one so a
connection is reserved immediately when found so a competing script
doesn't take up the connection in between

SELECT Server_ID, Server_Address, Server_Port WHERE
Servers.Server_Connections_In_Use < Servers.Server_Max_Connections
LIMIT 1"

UPDATE Servers SET Server_Connections_In_Use =
Server_Connections_In_Use+1 WHERE Server_ID = '$Server_ID' LIMIT 1

  Réponse avec citation
 
Page generated in 0,05073 seconds with 9 queries