嗨,我混淆了這一點。我怎麼能夠使這個查詢進入codeigniter模型查詢?這裏是我的PHP下面php本機查詢codeigniter查詢
$query = "SELECT
seminars.id,
seminars.thumb,
seminars_category.category,
seminars_category.url,
seminars_category.date,
seminars_category.abvr
FROM
seminars
INNER JOIN seminars_category ON seminars_category.id = seminars.category
WHERE seminars.id = 1 OR seminars.id = 7 OR seminars.id = 12 OR seminars.id = 20
OR seminars.id = 24 OR seminars.id = 29 OR seminars.id= 77 OR seminars.id = 84 OR seminars.id = 103
OR seminars.id = 157 OR seminars.id = 187 OR seminars.id = 234 OR seminars.id = 241 OR seminars.id = 308 OR seminars.id = 314 OR seminars.id = 390
OR seminars.id = 407 OR seminars.id = 414 OR seminars.id = 429 OR seminars.id = 455 OR seminars.id = 462 OR seminars.id = 511 OR seminars.id = 537 OR seminars.id = 573
OR seminars.id = 591 OR seminars.id = 641
ORDER BY seminars_category.date DESC
"
;
$res = mysql_query($query);
本地查詢我想這放在
public function getAllActivities(){
}
,並在我的位指示在這裏
$this->data['activities'] = $this->am->getAllActivities();
有人可以幫助我從PHP本地查詢到笨? ??
感謝
你所有你需要在這裏:http://ellislab.com/codeigniter/user-guide/database/active_record.html –
是的,我知道。它的所有在用戶指南 –