what I would like to do is to be able to offer a drop down list of values to select from ( which will come from a table in oracle) instead of the user remembering n entering a value, how can i achieve that ?
In HTML, what you're looking for is the <select> tag. This creates a dropdown list, like...
<select>
<option value="value">Text</option>
<option value="value">Text</option>
</select>
So what you need to do is get the result set from your database, loop through the result set, and create an <option> tag for each item in the result set.
I'm not familiar with the Oracle functions, so you'll have to create the query and what not yourself, but here's the idea.
$query = "SELECT value, text FROM table WHERE condition = TRUE";
$result = oci_execute($query, OCI_DEFAULT);
echo '<select>';
while ($row = oci_fetch_array($result)) {
echo '<option value='" . $row['value'] . '">' . $row['text'] . '</option>';
}
echo '</select>';
Hopefully you get the concept out of that, and you can fill in the right query/oracle functions to get it to work.
The steps are basically...
- Write query
- Execute query
- Open the <select>
- Loop through query results
- Print an option for each value in the query result set
- Close the <select>
Good luck,
- Walkere