私はphpの初心者です。phpを使用してオートコンプリートテキストボックスをコーディングしました。送信ボタンがあります。フォームアクションを指定していません。
これは、オートコンプリート テキスト ボックスに使用した HTML フォーム コードです。このオートコンプリート テキスト ボックスは値を選択します
<form method="post" autocomplete="off">
<p>
<b>Theater Name</b> <label>:</label>
<input type="text" name="theater" id="theater" />
</p>
<input type="submit" value="Submit" />
</form>
where句に基づいて値を取得する別のphp関数があります.whereステートメントでは、フォームから選択した値を使用したいと考えています。
例:劇場名が「フォームの値」である劇場から住所を選択
PHP関数でフォーム値を使用する方法は?誰でも私を助けることができますか?
<?php
$con = mysql_connect("localhost","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("theaterdb", $con);
$result = mysql_query("SELECT * FROM theter
WHERE theater_name="<!-- This could be value that we get after clicking submit button-->);
while($row = mysql_fetch_array($result))
{
echo $row['thearer_name'];
echo "<br />";
}
?>
前もって感謝します......