Add: edit player enter_code

This commit is contained in:
2019-03-15 12:31:44 +09:00
parent 703d381e79
commit 0cbf30481b
3 changed files with 73 additions and 4 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestroID = $_POST["maestro_id"];
$playerID = $_POST["player_id"];
$enterCode = $_POST["enter_code"];
/*
if(!is_numeric($enterCode)) {
send_error_code("생년월일이 숫자가 아닙니다. : ".$enterCode);
exit;
} else if(strlen($enterCode) != 6) {
send_error_code("6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131) : ".$enterCode);
exit;
}
*/
editPlayer($maestroID, $playerID, $enterCode);
set_data("EnterCode", $enterCode);
send_result_success();
exit;
function editPlayer($maestroID, $playerID, $enterCode) {
global $db_conn;
$query = "UPDATE player SET EnterCode=? WHERE MaestroID=? AND PlayerID=?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("sii", $enterCode, $maestroID, $playerID);
$stmt->execute();
}
?>