Jump to content

php select box from database


techker

Recommended Posts

Hey guys i have a products site and i put an edit product page , i need to put in a form of select box the database info but highlight the result in the table..

 

 

ok so lets say product car

 

name

id

type

brand ---> select box to edit the brand (select * from Brands) but incase he does not want to change that info i need the default to be the info stores already?

 

brand Honda -->select box highlight Honda 

 

this is the select i have 

div class="form-group">
    <label for="exampleInputName2">Brand :  <? echo $row['Brand'] ?></label>
   
    <select name="Brand"> 
    <?php 
while ($row2 = mysqli_fetch_array($result2))
{
 echo "<option value='".$row2['Name']."'>".$row2['Name']."</option>";
}
?>   
Link to comment
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.