 |
ปัญหา You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \wfht (name,email,mobile,password) values(asasd,asdasd,asdasdas,\ at line 1 |
|
 |
|
|
 |
 |
|
แก้ยังไงครับพอกรอกข้อมูลใส่แล้วมันขึ้นแบบนี้ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''wfht' (name,email,mobile,password) values('asasd','asdasd','asdasdas','' at line 1
Code (PHP)
<?php
include 'connect.php';
if(isset($_POST['submit'])){
$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST['mobile'];
$password=$_POST['password'];
$sql="insert into 'wfht' (name,email,mobile,password)
values('$name','$email','$mobile','$password')";
$result=mysqli_query($con,$sql);
if($result){
echo "Data Inserted Successfully";
}else{
die(mysqli_error($con));
}
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<title>WFHT</title>
</head>
<body>
<div class="container my-5">
<form method="post">
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" placeholder="Enter your name" name="name" autocomplete="off">
</div>
<div class="form-group">
<label>Email</label>
<input type="text" class="form-control" placeholder="Enter your email" name="email" autocomplete="off">
</div>
<div class="form-group">
<label>Mobile</label>
<input type="text" class="form-control" placeholder="Enter your mobile" name="mobile" autocomplete="off">
</div>
<div class="form-group">
<label>Password</label>
<input type="text" class="form-control" placeholder="Enter your password" name="password" autocomplete="off">
</div>
<button type="submit" class="btn btn-primary" name="submit">Submit</button>
</form>
</body>
</html>
Tag : PHP, MySQL, MySQL, HTML, Windows
|
|
 |
 |
 |
 |
Date :
2022-07-05 14:04:54 |
By :
adis |
View :
935 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|