INSERT INTO `users`(firstname,lastname,email,password,urole, phone) VALUES('Thankrit','Hayeewang','thanakrit19150@gmail.com',MD5('19112521'),'user','0910458021')
Fatal error: Uncaught mysqli_sql_exception: Unknown column 'phone' in 'field list' in C:\xampp\htdocs\triptravel\register.php:28 Stack trace: #0 C:\xampp\htdocs\triptravel\register.php(28): mysqli_query(Object(mysqli), 'INSERT INTO `us...') #1 {main} thrown in C:\xampp\htdocs\triptravel\register.php on line 28
register.php
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้<!DOCTYPE html>
<html lang="th">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Skydash Admin</title>
<!-- plugins:css -->
<link rel="stylesheet" href="vendors/feather/feather.css">
<link rel="stylesheet" href="vendors/ti-icons/css/themify-icons.css">
<link rel="stylesheet" href="vendors/css/vendor.bundle.base.css">
<!-- endinject -->
<!-- Plugin css for this page -->
<!-- End plugin css for this page -->
<!-- inject:css -->
<link rel="stylesheet" href="css/vertical-layout-light/style.css">
<!-- endinject -->
<link rel="shortcut icon" href="images/favicon.png" />
</head>
<body>
<?php
include "connect_db.php";
if (isset($_POST['Email'])){
echo $strSQL = "INSERT INTO `users`(firstname,lastname,email,password,urole, phone)
VALUES('".$_POST['Username']."','".$_POST['Lastname']."','".$_POST['Email']."',MD5('".$_POST['Password']."'),'user','".$_POST['phone']."')";
$objQuery = mysqli_query($con,$strSQL);
if($objQuery)
{
header("location:login.php");
}else{
echo "<script type='text/javascript'>alert('You are registered Fail.');</script>";
}
}
mysqli_close($con);
?>
<div class="container-scroller">
<div class="container-fluid page-body-wrapper full-page-wrapper">
<div class="content-wrapper d-flex align-items-center auth px-0">
<div class="row w-100 mx-0">
<div class="col-lg-4 mx-auto">
<div class="auth-form-light text-left py-5 px-4 px-sm-5">
<div class="brand-logo">
<img src="images/logo.svg" alt="logo">
</div>
<h4>ลงทะเบียนผู้ใช้</h4>
<h6 class="font-weight-light">Signing up is easy. It only takes a few steps</h6>
<form class="pt-3" name="RegisterForm" action="" method="post">
<div class="form-group">
<input type="text" class="form-control form-control-lg" name="Username" id="Username" placeholder="ชื่อ" required>
</div>
<div class="form-group">
<input type="text" class="form-control form-control-lg" name="Lastname" id="Lastname" placeholder="นามสกุล" required>
</div>
<div class="form-group">
<input type="email" class="form-control form-control-lg" name="Email" id="Email" placeholder="Email" required>
</div>
<div class="form-group">
<input type="tel" id="phone" name="phone" pattern="[0-9]{10}" class="form-control form-control-lg" placeholder="เบอร์โทรศัพท์">
</div>
<div class="form-group">
<input type="password" class="form-control form-control-lg" name="Password" id="Password" placeholder="Password" required>
</div>
<div class="form-group">
<input type="password" class="form-control form-control-lg" name="PasswordCheck" id="PasswordCheck" placeholder="RePassword" required>
</div>
<div class="mb-4">
<div class="form-check">
<label class="form-check-label text-muted">
<input type="checkbox" class="form-check-input">
I agree to all Terms & Conditions
</label>
</div>
</div>
<div class="mt-3">
<input type="submit" class="btn btn-block btn-primary btn-lg font-weight-medium auth-form-btn" name="Submit" value="ลงทะเบียน"/>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
<!-- plugins:js -->
<script src="vendors/js/vendor.bundle.base.js"></script>
<!-- endinject -->
<!-- Plugin js for this page -->
<!-- End plugin js for this page -->
<!-- inject:js -->
<script src="js/off-canvas.js"></script>
<script src="js/hoverable-collapse.js"></script>
<script src="js/template.js"></script>
<script src="js/settings.js"></script>
<script src="js/todolist.js"></script>
<!-- endinject -->
</body>
</html>
ช่วยแก้ error หน่อยครับ
Fatal error: Uncaught mysqli_sql_exception: Unknown column 'phone' in 'field list' in C:\xampp\htdocs\triptravel\register.php:28 Stack trace: #0 C:\xampp\htdocs\triptravel\register.php(28): mysqli_query(Object(mysqli), 'INSERT INTO `us...') #1 {main} thrown in C:\xampp\htdocs\triptravel\register.php on line 28
register.php
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้