i then want to take that array and use it to fill in options for a combo box in HTML
i have this code os far
Code: Select all
<?php
$sql="SELECT * FROM hotels order by city,name ;";
$result_set = pg_Exec ($conn, $sql);
$rows = pg_NumRows($result_set);
if ((!$result_set) || ($rows < 1)) {
echo "<H1>ERROR - no rows returned</H1><P>";
exit; //exit the script
}
for ($j=0; $j < $rows; $j++)
{
$name = pg_result($result_set, $j, "name");
$hotels[$j] = $name;
}
for ($i = 0; $i < $results = count($hotels); $i++){
}
?> <div id="form">
<form>
Choose Your Journey <br />
From: <br />
<select name ="From">
<option value=></option>
<option value=></option>
<option value=></option>
<option value=></option>
</select>
<br />
To: <br />
<select name ="To">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
</div>
i need both of those combox boxes to have the items from the array as options
Thank you very much in advance for your help.