我在表格中有一个字段,名为确认类型为tinyint.我想通过这个语句插入值(1)但它不起作用可以任何一个帮助?
$connect= mysql_connect("localhost","root") or die ("Sorry, Can not connect to database"); mysql_select_db("login") or die (mysql_error()); $user=$_POST['staff']; echo $user; $query="SELECT * from users where username='$user' "; $result=mysql_query($query,$connect) or die(mysql_error()); $row=mysql_fetch_array($result); $uid=$row['userid']; echo $uid; $query="SELECT * from opt where userid='$uid' "; $result=mysql_query($query,$connect) or die(mysql_error()); $row=mysql_fetch_array($result); if($row['confirm']==0) { $query = "INSERT INTO opt (confirm) values(1)"; echo 'The user selected options has confirmed'; } ?>
Bombe.. 8
您没有执行查询.
您没有执行查询.