Jump to content

populate a php form from a dropdown list


maichy

Recommended Posts

hi all,i have a php form that i would like to populate from a drop down list,my problem is that i cant place the drop down list at the correct place.what i want is that where the franchisee is the input should be the drop down,please help....this is the code that i am using

 

     <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<p>Add a Bus in the Bus table.</p>
<p>
  Fleet Number:<br />
  <input type="text" name="fleet_number" size="6" maxlength="10" value="" />
  </p>
  <p>
  Registration Number:<br />
  <input type="text" name="registration_number"  size="10" maxlength="20" value="" />
  </p>
  <p>
  Model:<br />
  <input type="text" name="model"  size="10" max length="15" value="" />
  </p>
  <p>
  Franchisee :<br />
  <input type="select" name="franchisee_id" size="10" max length="15" value="" />
  
  <select name=dropdown_list> 

    <?php   
  
    while($row = oci_fetch_array($stid))  
  
    {  
             
	echo "<option value='".$row['FRANCHISEE_NAME']."'>";
	echo $row['FRANCHISEE_NAME'];
	echo "</option> ";
  
    }   
    
  ?>  
  
  </select> 	
	</p>  
  <p>
  <input type="Submit" name="submit" value="Submit !" />
  </p>
</form>         

this form i do call it to insert the information to an oracle db,i have put the query into the script that inserts the information from the form to the db,i am nt sure if that should be the case. my query is as below

       $query= "SELECT franchisee_name FROM franchisee order by franchisee_id asc";

$stid = oci_parse($conn,$query);
oci_execute($stid);

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.