-2
我试图从文本框中获取值,但我失败了。 这是我codes.whatü要的就是数值超出文本框,并用这个简单的例子......当你邮寄的形式在我的数据库从文本框中获取值php
<form action="" method="post">
<strong>Code: *</strong> <input type="text" name = "code" >
<input type="submit" name="submit" value="Submit">
</form>
<?php
$code= $_POST["code"];
$sql = "SELECT bookingref FROM starpick";
$result = $mysqli->query($sql);
while (list($bookingref)=$result->fetch_row())
{
if (($bookingref == $code))
{
echo "Sorry, there was a problem uploading your file.";
}else
{
echo "==";
}
}
?>
考虑到添加WHERE子句中的SQL? – motto 2012-01-18 14:39:33
您的代码无条件运行,并执行PHP代码是否提交表单。 – 2012-01-18 14:42:58