参考:
/**
* 据用户输入的关键字查询相册信息;照片墙搜索框功能
* @param $keyWord 关键字
* @param $pageNum 页码,第几页
* @param $pageSize 单页记录数,偏移量
*/
public function getUserAlbumsByDesc($keyWord, $pageNum, $pageSize)
{
$keyWord = trim(urldecode($keyWord));
$sql = "SELECT a.*,b.user_nickname, b.user_head_url from qk_user_album a, qk_user b where a.album_user_id = b.user_id and a.album_desc like '%".$keyWord."%' ORDER BY a.album_create_date desc LIMIT ?, ?;";
$query = $this->db->query($sql, array(($pageNum - 1)*$pageSize,intval($pageSize) ));
//返回多行
return $query->result_array();
}