Ghetto Posted February 13, 2008 Posted February 13, 2008 Re: i need a little help with a function You need to add the the function 'ship_dropdown' into your global_func to make the dropdown menu work. Quote
carlg Posted February 13, 2008 Author Posted February 13, 2008 Re: i need a little help with a function thanks for that but i have a nothere problem it is not listing my ships would it be a error in my script or in the global_func this is what i put in the global_func function ship_dropdown($connection,$ddname="ship",$selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM ships_types ORDER BY shipname ASC"); if($selected < 1) { $ret.="<option value='0' selected='selected'>-- None --</option>"; } else { $ret.="<option value='0'>-- None --</option>"; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['shipid']}'"; if ($selected == $r['shipid']) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['shipname']}</option>"; } $ret.="\n</select>"; return $ret; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.