Jump to content

populate a php form from a dropdown list


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>
  Fleet Number:<br />
  <input type="text" name="fleet_number" size="6" maxlength="10" value="" />
  Registration Number:<br />
  <input type="text" name="registration_number"  size="10" maxlength="20" value="" />
  Model:<br />
  <input type="text" name="model"  size="10" max length="15" value="" />
  Franchisee :<br />
  <input type="select" name="franchisee_id" size="10" max length="15" value="" />
  <select name=dropdown_list> 

    while($row = oci_fetch_array($stid))  
	echo "<option value='".$row['FRANCHISEE_NAME']."'>";
	echo $row['FRANCHISEE_NAME'];
	echo "</option> ";
  <input type="Submit" name="submit" value="Submit !" />

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.