我只是使用 SQL 查询从数据库中提取了不同的健身房,现在必须根据下拉结果将它们拉入。这是我到目前为止所拥有的。任何帮助将非常感激。
<?php
require_once('connect.php'); //connecting to my database
mysql_select_db("gyms", $connect);
$result = mysql_query("SELECT * FROM gym WHERE id='1'"); //each gym has an "id" field of 1-5
while($row = mysql_fetch_array($result))
{
echo $row['name']; //all different attributes in the gym database
echo $row['type'];
echo $row['price'];
echo $row['hours'];
echo $row['parking'];
echo $row['facilities'];
}
?>