# Aucunes valeurs transmise => ce n'est pas un participant valide.
if ($v1 == NULL && $v2 == NULL)
return;
-
+
if (is_string($v1) && is_string($v2)) # Aucun des arguments n'est vide alors c'est le pseudo et le password qui ont été transmis
+ {
$res = pg_query_params("SELECT id FROM participants WHERE pseudo = $1 AND password = $2", array($v1, $v2));
+ }
else # Sinon c'est l'id
$res = pg_query_params("SELECT id FROM participants WHERE id = $1", array($v1));
- if (pg_result_status($res) == PGSQL_COMMAND_OK && pg_num_rows($res) === 1)
+ if (pg_result_status($res) == PGSQL_TUPLES_OK && pg_num_rows($res) === 1)
{
$this->id = pg_fetch_object($res)->id;
+ $this->chargerInfos();
}
}
$res = pg_query_params("SELECT * FROM participants WHERE id = $1", array($this->id));
- if (pg_result_status($res) == PGSQL_COMMAND_OK && pg_num_rows($res) === 1)
+ if (pg_result_status($res) == PGSQL_TUPLES_OK && pg_num_rows($res) === 1)
$this->info = pg_fetch_object($res);
else
$this->id = 0;
*/
static function nombre_participant_max_atteint()
{
- return $this->nombre_place_restante() <= 0;
+ return Participant::nombre_place_restante() <= 0;
}
/**