1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
$iduser = $_GET['idUser'];
$name = $_GET['nameUser'];
$firstname = $_GET['firstNameUser'];
$lastname = $_GET['lastNameUser'];
$sql='SELECT * FROM gamers WHERE FBID LIKE '.$iduser;
$result=mysqli_query($connect,$sql);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
echo '<response>';
if ($row == null){
//crée un nouveau joueur dans la BDD
$sql="INSERT INTO dbxxxxxxx.gamers (id, name, firstname, lastname, FBID, score, level, date) VALUES (NULL, $name, 'b' , 'c', $iduser, '0', '0','0')";
$result=mysqli_query($connect,$sql);
echo 'new player';
}
else
//renvoie les infos du joueur
{
echo $row['score'];
} |
Partager