I’m making an online store (backend and frontend) and I’m stucked in a probably simple detail. I have the products insert page done and working, and now I need to insert a product in a specific category and that’s my problem.
I have a lisbox where I want to show a list with all my categories. How do I show a category from a database in a listbox ?
Anyways, I’m assuming you have all the “items” in you table.
I’ll give you pseudo code, as I’m not exactly sure what your set up is.
do db connect, table select, and run the query to select items from the table, and get a $result resource.
echo "<select>";
for each item in your $result,
fetch item
and echo "<option>" . $item["itemName"] . "</option>";
end for
echo "</select>";