Jump to content

Select drop down from 2 colums. .


Bradley99

Recommended Posts

I have/need a select field in my form when it lists two separate columns inside a single option.

Here is the code I use for a single column:

<td class="profilerow" colspan="40%"><select name="fotn_id">      
<?php
$select_fotn = mysql_query("SELECT id, fighter1 FROM fights WHERE event='$viewevent' ORDER by id ASC");
while($the=mysql_fetch_object($select_fotn)){
	echo "<option value=\"" .$the->id . "\">" .$the->fighter1 .  "</option>\r";
}
?>

 

How can I change the query so that it lists not only $the->fighter1 BUT also lists $the->fighter2 after fighter1?

 

So like so. .

 

dropdown

fighter1

fighter2

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/264904-select-drop-down-from-2-colums/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.