Jump to content

select statement and <option> problem


brad12345

Recommended Posts

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

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.