Thread: Drop down menu
View Single Post
  #1  
Old 01-20-2004, 12:07 PM
 
Gibberish Gibberish is offline
 

Senior Member
  
Join Date: Sep 2003
Posts: 182
 

Default Drop down menu

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.
__________________
Gibberish
[Unix] X-Cart 4.0.12
Reply With Quote