correction d'erreurs
continuous-integration/drone/push Build is passing Details

peristanceBDD
Thomas Chazot 2 years ago
parent 55f297ca1c
commit 0f1439c8d2

@ -128,7 +128,7 @@ class UserGateway{
/// Returning TRUE if the user has been added succesfully, FALSE otherwise
public function postUser(string $username, string $password, string $nationality, string $sex, string $dateOfBirth) {
$insertUserQuery = "INSERT INTO T_S_USER_USR VALUES (NULL, :username, :password, :nationality, :sex, :dateOfBirth, 0, 0, 0, 1)";
$getLastIdQuery = "SELECT max(PK_ID) FROM T_S_USER_USR";
$getLastIdQuery = "SELECT max(PK_ID) id FROM T_S_USER_USR";
$argUser=array('username' => array($username, PDO::PARAM_STR),
'password' => array($password, PDO::PARAM_STR),
'nationality' => array($nationality, PDO::PARAM_STR),
@ -138,8 +138,7 @@ class UserGateway{
$this->connection->execQuery($getLastIdQuery, array());
$res=$this->connection->getRes();
foreach($res as $row){
echo "la je met le premier";
$this->putSkinList($row['PK_ID'], 1);
$this->putSkinList($row['id'], 1);
}
}

@ -182,7 +182,6 @@
break;
case 'POST':
if($method_name === "postUser"){ // test : OK
echo count($url);
if (count($url)<7){
//header("HTTP/1.0 400 Invalid number of arguments");
http_response_code(400);
@ -193,7 +192,6 @@
$sex = !empty($url[6]) ? (string) $url[6] : null;
$dateOfBirth = !empty($url[7]) ? (string) $url[7] : null;
$usergw->postUser($username,$password,$nationality,$sex,$dateOfBirth);
echo "je le met";
http_response_code(200);
}
elseif($method_name === "postMatch"){ // test : OK

Loading…
Cancel
Save