如果条件使用codeigniter

时间:2015-05-22 11:33:24

标签: php codeigniter session if-statement user-data

我是codeigniter的新手。当我从数据库中获取数据时,我没有def solve_ch17(fn): black, white = (0, 0, 0), (255, 255, 255) bg, fg = white, black # open image img = Image.open(fn) mx, my = img.size pix = img.load() # remove background for x in range(mx): for y in range(my): if pix[x,y] == white: pix[x,y] = fg else: pix[x,y] = bg # split text lx, ly = 70, 23 for c in range(6): for xi in range(9): for yi in range(12): x, y = lx + c*9 + xi, ly + yi if pix[x, y] == fg: nx = 15 + c*20 + xi pix[x, y], pix[nx, y] = bg, fg # scale up r = 3 img = img.resize((int(round(mx * r, 2)), int(round(my * r, 2))), Image.BICUBIC) # NEAREST, BILINEAR, BICUBIC img.save(fn + '.ppm') result = check_output(['ocrad', fn, + '.ppm']).strip().replace(' ', '') return result 语句的问题,它没有显示想要的结果,而且我有表名' users'在用户表中,一列是权利。我希望当用户登录时哪些权利具有' 1'他们显示管理员权限,而普通用户登录他们显示普通用户。我也在使用会话。 抱歉,我是英语新手。  我的代码是

process.on('uncaughtException', function handler(err) {
  // do stuf based on err, but make sure node.js quits after
  // displaying the error and performing basic cleanup - see below
})

1 个答案:

答案 0 :(得分:0)

试试这个

if($this->session->userdata('logged_in'))
{
$session_data = $this->session->userdata('logged_in');
if($session_data['rights']==1)
{
 //do something
}
}