MySQL实战基础知识入门(5):SMARTY 二次循环数组的输出方法

$page    = get_param('page');
		$page    = intval($page) == 0 ? 1 : intval($page);
		$pagenum = 15;
		$startI  = $page * $pagenum - $pagenum;

		//判断管理员与录入员权限,显示成绩匹配
		if ($_COOKIE["admin_is_super"] == "1") {
			//管理员读取全部列表;
			$count = $db->rowcount('achieve', '');
			$pages   = getPages($count, $page, $pagenum);
			$row   = $db->fetchall('achieve', 'achieve_id,category_id,category_name,member_depart,member_name,member_id,member_scan,user_id,user_name,total_seconds,achieve_score,entry_show,achieve_accurate,achieve_grade,achieve_time', '', ' achieve_id DESC', $startI . ',' . $pagenum);
		} else {
			//录入员读取个人操作列表;
			$count = $db->rowcount('achieve', array('user_id' => $_COOKIE["lg_id"]));
			$pages   = getPages($count, $page, $pagenum);
			$row   = $db->fetchall('achieve', 'achieve_id,category_id,category_name,member_depart,member_name,member_id,member_scan,user_id,user_name,total_seconds,achieve_score,entry_show,achieve_accurate,achieve_grade,achieve_time', array('user_id' => $_COOKIE["lg_id"]), ' achieve_id DESC', $startI . ',' . $pagenum);
		}
		//编辑菜单,读取项目分类;
		foreach ($row as $k => $v) {
			$category_name      = $v["category_name"];
			$row[$k]['cat_url'] = $db->fetch('category', 'category_name,category_editurl', array('category_name' => $v["category_name"]));
		}

Done!

你可能感兴趣的:(mysql,mysql,android,数据库)