我有一个 config.php 文件,其中包含连接信息和一个应该将用户数据发送到数据库的 php 脚本。没有解析错误,但数据库一直在表中显示 0 个条目。有什么建议么?
配置文件:
<?php
mysql_connect("mysql15.000webhost.com","a******94_admin","*********");
mysql_select_db("a******94_members");
?>
表单脚本:
<?php
require('scripts/config.php');
if(isset($_POST['submit'])) {
$u_name = ($_POST['u_name']);
$email = ($_POST['email']);
$password = ($_POST['password']);
mysql_query("INSERT INTO `members` (`id`, `u_name`, `email`, `password`) VALUES (NULL, '$u_name', '$email', '$password')");
} else {
} //end of first if/else statement
?>