Add: banned word DB

This commit is contained in:
2018-10-29 11:42:30 +09:00
parent ee2c537e54
commit 90c8ffa3a6
3 changed files with 35 additions and 2 deletions
+26
View File
@@ -7,6 +7,13 @@ include "./../setup/connect_db.php";
$maestro_name = $_POST["maestro_name"];
$banned_word = banned_maestro_name($maestro_name);
if($banned_word !== null) {
set_error_message($maestro_name." : 금칙어로 등록된 이름입니다. 다른 아이디로 입력해주세요.");
send_result_fail();
exit;
}
$maestro_id = get_maestro_id($maestro_name);
if($maestro_id !== null) {
set_error_code("registered_name");
@@ -20,6 +27,25 @@ exit;
function banned_maestro_name($maestroName) {
global $db_conn;
$query = "
SELECT Word
FROM banned_word
WHERE Word = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $maestroName);
$stmt->execute();
$stmt->bind_result($maestroID);
// while($stmt->fetch())
$stmt->fetch();
$stmt->close();
return $maestroID;
}
function get_maestro_id($maestro_name) {
global $db_conn;