My data doesn’t save in the database – sql

  database, mysql, php

I’m making a website but the sign up page is messing with me.
My ID is ‘cw’, password is ‘1234’ – until now

member_insert.php

<?php
$id= $_POST['id'];
$pass= $_POST['pass'];
$name= $_POST['name'];
$email1= $_POST['email1'];
$email2= $_POST['email2'];

$email= $email1 . "@" . $email2;

$regist_day= date("Y-m-d H:i"); //2020-01-08 (14:19)


include "../lib/dbconn.php";


$sql= "SELECT * FROM member WHERE id='$id'";
$result=mysqli_query($conn, $sql);
$rowNum= mysqli_num_rows($result); //결과표로부터 레코드 수 얻어오기

if($rowNum){
   
    echo("
        <script>
            alert('Choose another ID');
            history.back(); 
        </script>
    ");
    
    exit;
}



$sql= "INSERT INTO member(id, pass, name, email, regist_day, level, point) VALUES('$id','$pass','$name','$email','$regist_day','9','0')";


mysqli_query($conn,$sql);
mysqli_close($conn);


echo "
    <script>
    window.location.href='../index.php';
    </script>
";

?>

check_id.php

<meta charset="utf-8">

“;
echo “Choose another ID
“;
}else{
echo “Usable ID
“;
}

mysqli_close($conn);

?>

dbconn.php

enter code here

Source: Ask PHP

LEAVE A COMMENT