This is my code i have a table user_access in that it contains 3 coloumns user_id, access and budget code i want to work with access and user_id. please give any suggestions as i am not getting it in the right way. thankyou <?php require_once('auth.php'); require_once('connection.php'); $user_id=$_SESSION['SESS_USER_ID']; $query=mysql_query("SELECT DISTINCT access FROM user_access WHERE user_id=$user_id") or die(mysql_error()); ($rows=mysql_fetch_array($query)); $access1= $rows['access']=='entry'; $con1= $rows['access']=='approver1' && $rows['access']=='approver2'; $con2= $rows['access']=='approver2'&& $rows['access']=='approver3'; $con3= $rows['access']=='approver3'&& $rows['access']=='approver1'; $con4= $rows['access']=='approver1'&& $rows['access']=='approver2' && $rows['access']=='approver3'; if ($access1){ echo '<tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'status.php\'" /> </label></td> <td width="70%" align="left">Enter Spend Request</td> </tr> <tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'delete-resubmit.php\'"/> </label></td> <td width="70%" align="left" >Delete/Resubmit Spend Request</td> </tr>'; } else if ($con1) { echo '<tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app1.php\'" /> </label></td> <td width="70%" align="left">Approver 1</td> </tr> <tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app3.php\'" /> </label></td> <td width="70%" align="left">Approver 3</td> </tr>'; } else if ($con2){ echo '<tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app1.php\'" /> </label></td> <td width="70%" align="left">Approver 1</td> </tr> <tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app2.php\'" /> </label></td> <td width="70%" align="left">Approver 2</td> </tr>'; } else if ($con3){ echo '<tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app2.php\'" /> </label></td> <td width="70%" align="left">Approver 2</td> </tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app3.php\'" /> </label></td> <td width="70%" align="left">Approver 3</td> </tr>'; } else if ($con4){ echo '<tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app1.php\'" /> </label></td> <td width="70%" align="left">Approver 1</td> </tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app2.php\'" /> </label></td> <td width="70%" align="left">Approver 2</td> </tr> <td width="30%" align="right"><label> <input type=\'radio\' name=\'selection\' value=\'\' id=\'selection_0\' onClick="location.href=\'app3.php\'" /> </label></td> <td width="70%" align="left">Approver 3</td> </tr>'; } ; ?>
"i am not getting it in the right way" doesn't tell us anything. What do you want to get and what are you getting?