I hate to give in but this has got me stuck...

I'm simply adding a field just under the Login, Password section in
edit_user that will allow Admin to change permissions. So far I have the
field as you can see below but I cannot find or work out the way to get the
Permission name of the currently selected user to set the SELECTED option.

e.g.

If Bob Sample's Permission is "Administrate" I want that selected in the
field when I go to edit_user.

I've tried fiddling with GetUserInfo() but to no avail. Any help would be
very much appreciated.

------the script so far--------------->

/* User Permission Field. */
print("<TR>\n");
print("<TD>User Permission</TD>\n");
print("<TD>");
print("<SELECT NAME=\"user_permission\">\n");

$Query = "SELECT ID, Name ";
$Query .= "FROM permission  ";
$DatabaseResult = mysql_query($Query, $DatabaseLink);
while($DatabaseRow = mysql_fetch_row($DatabaseResult))
{
    print("<OPTION VALUE=\"$DatabaseRow[0]\"");
    if($DatabaseRow[0] == $DatabaseRow[2] )
    {
        print(" SELECTED");
    }
    print(">" . prepareText($DatabaseRow[1]) . "\n");
}
print("</SELECT>");
print("</TD>\n");
print("</TR>\n");

---------------------------------------+

Thanks,

Nick Lo

----------------------
Lab2 Design-Unit
URL: www.lab2.com.au
e-mail: [EMAIL PROTECTED]
----------------------




------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to