728x90
반응형
<?php
extract($_POST);
echo $user_id.'<br>';
echo $user_pass.'<br>';
echo $user_email.'<br>';
$mysqli = new mysqli("localhost", "root", "password", "DB");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
$query="INSERT INTO `join` ( `id`, `pw`, `email` ) VALUES ( '$user_id', '$user_pass', '$user_email' )";
$mysqli->query($query);
if($mysqli->insert_id) {
echo 1;
} else {
echo 2;
}
?>
반응형
'엔지니어 > Php' 카테고리의 다른 글
Client IP 문제(X-Forwarded-For) 해결 방안 (0) | 2016.05.26 |
---|---|
JSON Example(with php,mysql) (0) | 2016.05.26 |