I need some help with a drop down menu I am trying to pull from the database.
What I am trying to do is generate a pull down menu from the brand field in the database based on if the categoryid on that same row as the brand matches the category currently being browsed.
Here is my select tag
Code:
<select name=brands>
{section name=brands loop=$brand_query}
<option {if $products[product].brand eq $brand_query[brands]}selected{/if}>{$brand_query[brands]}</option>
{/section}
</select>
Hee is my php
Code:
function brand_query() {
$brand_query = "select $sql_tbl[products].brand where $sql_tbl[products].categoryid = $cat";
}
$smarty->assign("main","specific_search.tpl")
?>
If someone could please make some suggestions or give me a push in the right direction it would be much appreciated.
I am going to keep working on it, and reading my php book.
Thanks.