> I have a site with all my movies and stuff stored in a database. And I
> have
> made a admin page where I can add, delete and update records. When I
add
> new
> records, I have made a listbox for the category (ex. action, comedy
etc.)
> so
> I dont have to write it every time I add a new record. But when I push
the
> update button and the data thats stored in the database is printed its
> printed just in a textarea. I know its possible to list the data in a
> listbox, but how do I get the right category selected for the movie I
> choose?

<select name="whatever">
<option value="1" <?if($something==1) { echo "selected"; }
?>>One</option>
<option value="2" <?if($something==2) { echo "selected"; }
?>>Two</option>
etc...
</select>

Put it into a function and the possible values into an array to make it
easier...

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to