i used array function to show list of drop down but for edit the form i want to show fetched value but it show some error.
my code is
<td class="tdcls">Bus Name</td>

<tr>
     <td class="tdcls">Bus Name</td>
     <td><select name="bus_name" required>
     <option value="#">Select</option>
     <?php 
     $busName= getBusName();
     foreach($busName as $code=>$bname)
     {
         echo "<option value=\"$code\" if(isset($_REQUEST['do'])=='edit'){ echo $seldata['bus_name']}>$bname</option>";
     }
     ?>
     </select>
     </td>
    </tr>



 please give me solution...help me.

Try this:

foreach($busName as $code=>$bname)
 {
    $edit = (isset($_REQUEST['do'])=='edit' ? $seldata['bus_name'] : "";

     echo "<option value=\"$code\" $edit>$bname</option>";
 }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.