I have these profiles saved in a database with lots of random information like name, gender, age, etc.
The user can edit their profile by clicking a hyperlink and it takes them to a form much like the one they filled out when they first registered. I've designed it so all the text input fields already have the values they had previously filled in. Here's an example of what one looks like:
<input type="text" name="fname" value="<?php echo $result['firstName']; ?>"/>
As you can see I'm echoing their name from the array I created from querying the database. But the problem is I used radio buttons (and drop down boxes too) for some of these inputs like gender.
So how do I check the appropriate radio button once I establish they're male or female from the database?
i think it's simplier. because they can;t be both, at the same time.
Very easily:
Same thing for a select box, when listing the options check and see if their stored value is the same as the
value
of theoption
you're listing.something like this: