(说明:数据获得了,但就存不到mysql?)
第一部分:
第二部分:
$username =$_POST['username'];
$userpass =$_POST['userpass'];
$conn = mysql_connect("localhost", "root", "admin") or die("连接错误".MySQL_error()) ;
mysql_select_db("test", $conn);
$sql="INSERT INTO cctm_tal(username,userpass) VALUES ('$username','$userpass')";
MySQL_query($sql,$conn);
echo "注册成功.";
mysql_close($conn);
?>
第三部分:(表字段)
CREATE TABLE `cctm_tal` (
`username` varchar(255) NOT NULL,
`userpass` varchar(255) NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
回复讨论(解决方案)
贴出来报错信息 是没权限还是格式错误还是语法错误
谢谢楼上朋友,我问题已解决,(程序没问题,设置有误。)
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn