-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