PDA

View Full Version : list menu + label text


Coito
01-10-2009, 03:29 PM
hi everyone, i'm new to php and was trying to create a listmenu that would change the text automatically, acorddingn to the data in my sql db, anyone knows how? thanks!

edbr
01-12-2009, 01:25 AM
basically you could use a a loop and repeat
<select><?php echo $your_row['your-field']; ?php> </select>

Coito
01-13-2009, 01:14 AM
thanks for the reply! and where would i put that? in the list or in the label?? thanks

edbr
01-13-2009, 01:36 AM
in the form. page would need to be php of course but after the the select
<select name="your-field" size="1" id="your-field">

<?php do { ?>

<option value="<?php echo $row['title']?>"><?php echo $row['title']?></option>

<?php } while ($row = mysql_fetch_assoc($row)); ?>

Coito
01-13-2009, 10:58 AM
got it, many thanks!