我目前在用户以文本类型表单输入后获取以下代码来更新MySQLi时遇到问题:
print "<input type='text' name='prof' >Prof<br />";
$profselectorX=$_POST['prof'];
$profselector=$mysqli->real_escape_string($profselectorX);
$query="UPDATE homework1 SET 'prof'='".$profselector."' WHERE idnumber='".$editselector."'";
$resultz=$mysqli->query($query) or die($mysqli->error);
提前谢谢!
答案 0 :(得分:0)
像这样重写您的查询
$query="UPDATE `homework1` SET `prof`='$profselector' WHERE `idnumber`='$editselector'";