displaying a oolumn from mysql within dropdown dialogue box

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkenroyce
Forum Newbie
Posts: 2
Joined: Fri Mar 28, 2008 1:00 pm

displaying a oolumn from mysql within dropdown dialogue box

Post by darkenroyce »

finished
Last edited by darkenroyce on Sun Mar 30, 2008 5:30 pm, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Re: displaying a oolumn from mysql within dropdown dialogue box

Post by hawleyjr »

There are ways to run PHP within an HTML file but for now just rename the file to PHP.

In your HTML <select></select> tags print your database fields:

Code: Select all

 
<select>
<?php 
$aData = array('one','two','tree');#REPLACE WITH DATABASE DATA
foreach( $aData as $test ){
echo '<option value="' . $test . '">' . $test . '</option>';
}
?>
</select>
 
 
darkenroyce
Forum Newbie
Posts: 2
Joined: Fri Mar 28, 2008 1:00 pm

Re: displaying a oolumn from mysql within dropdown dialogue box

Post by darkenroyce »

finished
AMCH
Forum Commoner
Posts: 31
Joined: Sun Mar 30, 2008 4:39 pm

Re: displaying a oolumn from mysql within dropdown dialogue box

Post by AMCH »

darkenroyce wrote:finished
:? Rather annoying that you edited this and took out the original question, it would be nice for others to be able to see the problem and the solution too. :crazy:
Post Reply