Maison >développement back-end >tutoriel php >我的第三行PHP代码之接受安卓端get请求,注册新用户写入数据库
<?php $con=mysql_connect("localhost","root","") or die("failed to connect db"); mysql_select_db("lio")or die ("failed to select db"); $user=$_GET['user']; $passwd=$_GET['passwd']; $i="INSERT INTO `userinfo` ( `user` , `passwd` ) VALUES ('$user','$passwd')";echo $i; mysql_query($i);?>