Jump to content
MakeWebGames

i need a little help with a function


carlg

Recommended Posts

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;
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...