我在我的网站上有以下 PHP 代码/文件,但由于某些不正当的原因,它不会按照需要将用户输入的记录插入到 mySQL 数据库表中。谁能告诉我这是为什么?
据我所知,代码是完全正确的,我不知道为什么会这样......
请帮助...代码如下...
<html>
<head>
</head>
<body>
<form action="register_development_file_1.php" method="post">
Email: <input type="text" name="email"><br />
Date: <input type="text" name="date"><br />
Time: <input type="text" name="time"><br />
<input type="submit" name="submit">
</form>
<?php
if (isset($_POST['submit']))
{
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die("Could not connect to the database: " . mysql_error());
}
mysql_select_db("wwwbrecs_BREC",$con);
$sql = "INSERT INTO 'signups' ('signup_email_address', 'signup_date', 'signup_time') VALUES ('$_POST[email]','$_POST[date]','$_POST[time]')";
mysql_query($sql,$con);
mysql_close($con);
}
?>
</body>
</html>