maichy Posted March 25, 2011 Share Posted March 25, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/231663-populate-a-php-form-from-a-dropdown-list/ Share on other sites More sharing options...
MrXHellboy Posted March 25, 2011 Share Posted March 25, 2011 Your list is empty ? Or what ? you placed it @ the correct place but i dont get what your issie is Quote Link to comment https://forums.phpfreaks.com/topic/231663-populate-a-php-form-from-a-dropdown-list/#findComment-1192063 Share on other sites More sharing options...
maichy Posted March 25, 2011 Author Share Posted March 25, 2011 my issue is when i get the form,where the franchisee is to be input there is no drop down list,it is just a normal text box where you type the name,which is not what i want Quote Link to comment https://forums.phpfreaks.com/topic/231663-populate-a-php-form-from-a-dropdown-list/#findComment-1192064 Share on other sites More sharing options...
MrXHellboy Posted March 25, 2011 Share Posted March 25, 2011 1) <select name=dropdown_list> -> <select name="dropdown_list"> 2) I dont see your query 3) type echo 'Hello World'; somewhere Quote Link to comment https://forums.phpfreaks.com/topic/231663-populate-a-php-form-from-a-dropdown-list/#findComment-1192069 Share on other sites More sharing options...
maichy Posted March 25, 2011 Author Share Posted March 25, 2011 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); Quote Link to comment https://forums.phpfreaks.com/topic/231663-populate-a-php-form-from-a-dropdown-list/#findComment-1192074 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.