Hi all,

I have a table with multiple apps listed on it. The table is auto populated with the all available apps. The admin then has a options to assign user permissions e.g. user, admin or none. I have attached a pic of my table.

I wanted to know how to save these individual permissions to my user access table. I have two tables as shown below.

table 1 - app [app_id, app_name .... more]
table 2 - user_access [ id, user_id, app_id, lastlogin, expiry, user_level]

The code for my populating my table is within a while loop is shown below.

$app_level = $row['app_level'];
				
<tr class="mouse_hover">

<td><?=$app_id?></td>
<td><?=$app_name?></td>
<td><?=$last_login?></td>             
<td><?=$app_expiry?></td>

<td align="center"><input type="radio" name="<?=$app_id?>" value="2" <?php if($app_level==3){echo 'checked="checked"';}?>></td>

<td align="center"><input type="radio" name="<?=$app_id?>" value="1" <?php if($app_level==2){echo 'checked="checked"';}?>></td>

<td align="center"><input type="radio" name="<?=$app_id?>" value="0" <?php if($app_level==1 || empty($app_level)){echo 'checked="checked"';}?>></td>

 </tr>

I will be saving my results by posting to another .php. I guessing I have to save the results with a array, but if i do that how would i save them using a mysql_query.

I dont know where o start!!!

If anyone can help or point me in the right direction, will be much appriciated.

Thanks in advance.

Grab the data from radio buttons by the name like any other input.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.