Sql drop down menu question?
-
Hi i was just wondering if anyone knew how to generate a drop down menu with sql. The section of code i have that has to be changed is <div> <span class="bold">Choose a lecturer:</span><br> <?php // note how the keyword "distinct" in the following query prevents duplicate values from being returned $dbQuery="select distinct lecturer from p3_modules"; $dbResult=mysql_query($dbQuery,$db); // convert this loop to generate a drop down list (3a) // the value of each <option> element should be the lecturer's name // enclose the drop down list in a form with action=showModules.php while ($dbRow=mysql_fetch_array($dbResult)) { $thisLecturer=$dbRow["lecturer"]; echo "$thisLecturer<br>"; } // add a submit button for the form ?> </div>
-
Answer:
echo " <option>$thisLecturer</option>";
Laura at Yahoo! Answers Visit the source
Other answers
echo " <option>$thisLecturer</option>";
Mark O
Related Q & A:
- Is it possible to request Google and Bing/Yahoo to drop the cache of links they have indexed?Best solution by Webmasters
- How to drop all connections to a specific database in postgres without stopping the server?Best solution by Database Administrators
- How can I optimize this dynamic SQL query in oracle with PL/SQL?Best solution by docs.oracle.com
- How to check if drop down menu of ActionBar is active?Best solution by Stack Overflow
- How to make scroll bar drop with a down menu?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.