-2
私は良いコードで作業していますが、結果が0の場合は結果が0の場合は必要です( 'Location:checkin.php?identity ='。$ identity);mysqlからデータをフェッチしますが、結果が0の場合リダイレクト
ここに私のコード
<?php
mysql_connect("localhost", "xxxxxx", "xxxxxx") or die("Connection Failed");
mysql_select_db("xxxxxx")or die("Connection Failed");
//added to prevent sql injection
$identity = mysql_real_escape_string($_POST['identity']);
$query = "select * from blacklist where identity = '$identity'";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "{$line['number']}<br>";
echo "{$line['identity']}</div></td><br>";
echo "{$line['reason']}</div></td><br>";
}
?>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form method="post" name="display" action="index.php" />
<b>Enter the register number:</b><br>
<input type="text" name="identity" />
<input type="submit" value="Search" />
</form>
</html>
..だから何あなたの問題であり、選択した場合は? – Ravi