The following is a specific example from my roster system tied into my .Threads install.
In this example I populate a drop down box for my members to choose from a list of possible classes avaiable on EverQuest.
All this comes from a globals file I use so I can keep my templates cleaner and this code is used on multiple pages.
----
Query $EQClass_query = mysql_query("SELECT EQClassID, EQClass<br /> FROM {$config['tbprefix']}eqclass ORDER BY EQClass");
Code for drop down box <br /><br />// Build the class select box<br />$selecteqclass_select = "<select name=\"EQClassID\" class=\"formboxes\">";<br /><br />while ($class = mysql_fetch_array($EQClass_query)){<br /> extract($class,EXTR_PREFIX_ALL,"v");<br /> { <br /> $selecteqclass_options .= "<option value=\"$v_EQClassID\">$v_EQClass</option>"; <br /> }<br />}<br /><br />$selecteqclass_end .= "</select>";
How I implement it on the template file Template code <b>Class:</b><br />$selecteqclass_select<br />$selecteqclass_options<br />$selecteqclass_end<br /><br />
And finally, an example is attached as to how it displays.
Hope that helps some.
