Ok, so I've been LOOKING and LOOKING ... and I've found bits and pieces ... but here's what I've got and what I want to accomplish.
I have a MySQL database, with one table "staff", and in that I have about 10 fields with information about the staff member. And about 20 rows of dif. staff members.
I have managed to make an Index PHP page that pulls just the name and email. And make the name link thru to a detailed page which has the rest of the information. I've even got some Previous and Next links working!
HOWEVER, now I want to go the next step and create a page that Staff Members can access to change their own profiles.
So 1st) I need to have an Admin Passworded Page (that shouldn't be hard, I've seen lots of those around)
2nd) I need to have a select menu (dropdown) that when users click on a Staff Name their details are shown and editable.
3rd) Sending the updated data back to the database.
I know the 3rd part is easy to find as well, but I'm REALLY stuck on the 2nd thing. How can I make a dropdown (select) menu pulling from my DB? And then have it change the details on the page?
Thanks!!
Joel
Oh, here's the code I have so far:
<form name=wordlist method=post action="<?php echo $PHP_SELF?>"><center>
Select a Word Type or Enter a New Type<BR>
<input type="hidden" value="id">
<select name="selecttype" class="sel"><option>Staff Member</option>
<?
{
$result = mysql_query("SELECT * FROM staff ORDER BY StaffID ASC");
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
do {
printf("<option value=\"%s\">%s</option>", $myrow["selecttype"], $myrow["selecttype"]);
} while ($myrow = mysql_fetch_array($result));
}
} ?></select>