Add: sql - login, history_record

This commit is contained in:
2018-05-17 18:51:09 +09:00
parent 976e5563b7
commit 235327cd3e
19 changed files with 529 additions and 91 deletions
+1
View File
@@ -18,6 +18,7 @@
<script src="../../game/lib/input_type_text.js"></script>
<script src="../../game/lib/round_rect_button.js"></script>
<script src="../../game/lib/fullscreen_button.js"></script>
<script src="../../game/lib/db_connect_manager.js"></script>
<!-- source files -->
<script src="../../game/login/login.js"></script>
-31
View File
@@ -1,31 +0,0 @@
<?php
header('Content-Type: application/json');
include "send_error_code.php";
$name = $_POST["name"];
$birthday = $_POST["birthday"];
if(!is_numeric($birthday)) {
send_error_code('생년월일이 숫자가 아닙니다. : '.$birthday);
exit;
} else if(strlen($birthday) != 6) {
send_error_code('6자리 숫자값을 정확히 입력하세요 : YYMMDD (예 : 120131) : '.$birthday);
exit;
}
include "connect_db.php";
$return_array = array();
$query = "SELECT UserID FROM afterschool_user WHERE Name=? AND Birthday=?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('ss', $name, $birthday);
$stmt->execute();
$stmt->bind_result($user_id);
// while($stmt->fetch())
$stmt->fetch();
$jsonUserData["UserID"] = $user_id;
echo json_encode($jsonUserData, JSON_UNESCAPED_UNICODE);
?>
-24
View File
@@ -1,24 +0,0 @@
<?php
$hasServiceDBSetting = file_exists("./service_db_setting.php");
if($hasServiceDBSetting == true) {
include("./service_db_setting.php");
} else {
$db_host = "localhost";
$db_user = "afterschool";
$db_passwd = "sEobMPuJ2A8KTfwU";
$db_name = "jisangs";
}
$db_conn = new mysqli($db_host, $db_user, $db_passwd, $db_name);
if ($db_conn->connect_error) {
send_error_code("Connection failed: ".$db_conn->connect_error);
exit;
}
$query = "USE jisangs";
$result = mysqli_query($db_conn, $query);
?>
-15
View File
@@ -1,15 +0,0 @@
<?php
$db_host = "localhost";
$db_user = "afterschool";
$db_passwd = "sEobMPuJ2A8KTfwU";
$db_name = "jisangs";
$db_conn = new mysqli($db_host, $db_user, $db_passwd, $db_name);
if ($db_conn->connect_error) {
send_error_code("Connection failed: ".$db_conn->connect_error);
exit;
}
?>
-10
View File
@@ -1,10 +0,0 @@
<?php
function send_error_code($error_code) {
$returnValue = array(
'error' => $error_code
);
echo json_encode($returnValue, JSON_UNESCAPED_UNICODE);
}
?>