aaa
用户名:aaa
$conn=mysql_connect("localhost","root",""); //echo $conn; mysql_select_db("aaa",$conn); mysql_query("set names gb2312"); $name=$_POST["name"]; //这个是input框中的输入 $pwd=$_POST["pwd"]; //这个是input框中的输入 if (!$name || !$pwd) { echo "You have not entered all the required details."; exit; } $query="INSERT INTO usr VALUES(NULL,'$name','$pwd')";//NULL 是自动增加的ID字段 $result=mysql_query($query); if($result) { echo "insert OK"; } ?> 展开 |