Hi,
I created databases for a book store and I would like to create an Order process page that will contain customer name and book name and the other details. I have the following tables
customer - {cust_id, name and etc...}
book - {book_id, title and etc .......}
order {order_id order_date and etc........}
orderBook - {order_id, book_id, cust_id and etc..}
what i would like to do is in the order page I would like to populate customer id and name to the listbox from customer table and pass only the cust_id to process_order php, and the same with books.
Is there an easy way of implementing the code? Please help me as I am stuck on this problem for more than a week
Thank you
Populate listbox from a table PLEASE HELP
Moderator: General Moderators
you just need the drop down menu?
if so...
<select name="cust_id" size="1">
</select>
if so...
<select name="cust_id" size="1">
Code: Select all
<?php
$query = mysql_query("select ID, name from custmers order by name ASC");
while($row= mysql_fetch_array($query))
{
echo '<option value="'.$row['ID'].'">'.$row['name'].'</option>';
}
?>