Forum Moderators: coopster
Hopefully someone can help me.
I have a script that is basically an advanced address book. The script is written for referees to be able to show their availability for a season and their information, along with address phone email and things are all stored in a database.
I think i have the 'entering' portion of it fine. But, in the new user page, there are drop downs with selections to be made. I have managed to get the variables from the drop downs to post into the database. THIS IS CONFIRMED when i browse the database thru phpadmin, i see the variable entries.
Now, obviously, like everything in the world, plans change. There is a link in the admin section that allows the admin to 'edit' the user details.
I have my problems solved up to the point of echoing the variable data back into a drop down box.
Another words:
A user says On the 17th of Sept, I am available for PM Games.
The options when first entering the information in is:
N/A
PM
Obviously the value will be set to output what I wish. But the question is, how can i get it to allow the admin to edit the details and see that the user originally selected PM?
I am including a portion of the code that surrounds the 'edit' area of the php.
I hope that someone could help me with this, it was all going fine until this point.
Heres the portion of the code.
**********************************************
<td width="91">Sept 14</td>
<td width="186"><select name="select" id="select3">
<option value="N/A" selected>N/A</option>
<option value="AM">AM</option>
<option value="PM">PM</option>
<option value="All Day">All Day</option>
</select></td>
**********************************
How do i write the php around that to echo the variable in the database?
thanks
<SELECT NAME=\"section\">";
$h=mysql_query("SELECT specialismid,longname FROM specialisms WHERE 1");
while ($r=mysql_fetch_row($h))
{
$out=$out."<OPTION id=\"\" value=\"$r[0]\">$r[1]";
}
$out=$out."</SELECT>";
echo $out;