我收到以下错误:
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 ''login' ('id', 'uname', email', 'pass') VALUES (NULL, 'X', 'X' at line 1
代码如下:
<?php
require('config.php');
if(isset($_POST['submit'])){
//Perform the verification
$email1 = $_POST['email1'];
$email2 = $_POST['email2'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
if($email1 == $email2){
if($pass1 == $pass2){
//All good. Carry on.
$uname = mysql_escape_string($_POST['uname']);
$email1 = mysql_escape_string($email1);
$email2 = mysql_escape_string($email2);
$pass1 = mysql_escape_string($pass1);
$pass2 = mysql_escape_string($pass2);
mysql_query("INSERT INTO 'login'
('id', 'uname', email', 'pass')
VALUES (NULL, '$uname', '$email1', '$pass1')") or die(mysql_error());
}else{
echo "Passwords do not match.<br />";
exit();
}
}else{
echo "Emails do not match.<br /><br />";
exit();
}
有人可以把我推向正确的方向吗
亲切的问候,