brad12345 Posted April 3, 2008 Share Posted April 3, 2008 Hey guys im trying to have a drop down option box that has the "ownerID" plus next to it the owners "name" what is the correct way of producing both these in this way. looks like this when the drop down box is clicked. ID Name 234 harry manering 235 simon goodfreed 236 marry bird etc. //Selects $result=mysql_query("select ownerID, name from tblOwnerBK "); echo ("Select the pets owner : <SELECT name='ownerID'>"); while ($row = mysql_fetch_assoc($result)) { //////////////////////////////////////////////////////////////////////////// // I think this is where im going wrong below echo ("<OPTION value=''>".$row['ownerID','name']."</OPTION>"); //////////////////////////////////////////////////////////////////////////// } echo ("</SELECT>"); thanks Link to comment https://forums.phpfreaks.com/topic/99291-select-statement-and-problem/ Share on other sites More sharing options...
uniflare Posted April 3, 2008 Share Posted April 3, 2008 try: echo ("<OPTION value='".$row['ownerID']."'>".$row['ownerID']." ".$row['name']."</OPTION>"); Link to comment https://forums.phpfreaks.com/topic/99291-select-statement-and-problem/#findComment-508027 Share on other sites More sharing options...
brad12345 Posted April 3, 2008 Author Share Posted April 3, 2008 Thanks alot dude worked a charm! stoked! Link to comment https://forums.phpfreaks.com/topic/99291-select-statement-and-problem/#findComment-508028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.