php - sql query depending on case statement -
can not correct case run query... have variables listed elsewhere in page...
if (isset($_session['user_level'])) {...
and block of code pagination...(which works fine)
and rest of code
$user_level = ($_session['user_level']); switch ('user_level'){ case 0: $user_level = "select * cases $current_user = user_id order $order_by limit $start_from, $per_page "; break; case 1: $user_level = "select * cases $current_user = user_id order $order_by limit $start_from, $per_page "; break; case 2: $user_level = "select * cases order $order_by limit $start_from, $per_page "; break; case 3: $user_level = "select * cases order $order_by limit $start_from, $per_page "; break; default: $user_level = "select * cases order $order_by limit $start_from, $per_page"; } $query = $user_level;
and ends while statement. if use... $query = "select..." returns rows, , every user sees elses rows. have adjusted user_level inside database gather clue haven't. user levels new_user, normal_user, technichian, admin. , each have different permissions.
not sure you're doing here:
switch ('user_level'){
the variable called $user_level
. so:
switch ($user_level) {
Comments
Post a Comment