I need to query data from a table accourding to user level to genarate a menu list for different user levels, the code worked well with (session->username) but when I changed to (session->user_level) it does not want to work.
Any help will be appreciated.
Here is my code:
<?php
if($session->logged_in){
$user = ($session->userlevel);
$t_user = trim($user);
$result = mysql_query("SELECT * FROM menu_1 WHERE '$t_user' = '1'");
while($row = mysql_fetch_array($result))
{
echo"<a href=\"".$row['href']."\">".$row['item']."</a>";
echo"<br />";
}
}
?>
Thank you in advance.
Max