Welcome Guest, Not a member yet? Register   Sign In
Selecting?
#11

[eluser]CroNiX[/eluser]
Well, if you use one of the queries that people helped with from above, where the query checks for
Code:
is_admin = 1
, then you don't need that is_admin() function in your view because you already KNOW they are admin, or there wouldn't be a result from the query.

So, why are you still checking with
Code:
if ($this->is_admin())
in your view? 2 People above pointed out the error... There is no function called is_admin() in your view...
#12

[eluser]InsiteFX[/eluser]
Look at your query better!
Code:
function is_admin()
{
  $session = $this->session->userdata('username');
  return $this->db->query("SELECT * FROM `users` WHERE `username` = '{$session}' AND `is_admin` = '1'")->row();

  }

And I do not understand why you did not use the query PhilTem showed you!




Theme © iAndrew 2016 - Forum software by © MyBB