| deserts |
2006-11-06 11:00 |
做好了前台,你现在应该到相应的目录里写你的reg.php了,他是负责和mysql进行交互的服务器端的脚本。 reg.php <?php $db=mysql_connect('localhost','root');//连接数据库 mysql_select_db('flash',$db); //选择数据库 $n=$_POST["Name"]; //接受你插入进来的变量 $e=$_POST["Email"]; //接受你插入进来的变量 $l=$_POST["Location"]; //接受你插入进来的变量 $query="INSERT INTO users (Name,Email,Location) VALUES ('$n','$e','$l')";//写插入语句 $result = mysql_query ($query); //执行查询 ?>
OK!这时候你就可以点一下前端flash的按钮了,做好了之后,到数据库里看一看select * from users;应该没问题吧,你应该可以看到你写入的数据了。 |
|