Jump to content

populating a drop down box using values in a table


Recommended Posts

hi i am working on populating a drop down menu with a select statement and have got so far.

The drop down box is populated with value however the value are null.  Can anyone help?

$query="select distinct(house_type) from tbl_accommodation";
$stmt = ociparse($conn, $query);
ociexecute($stmt);

echo '<select name="house_type">';
echo '<option value = "-1">Select:</option>';

while($row=ocifetch($stmt)) {
echo $row;
		echo '<option value=' . $row['house_type'] . '>' . $row['house_type'] . '</option>';
	}
		echo '</select>';

  • 2 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.