من یه جدول اخبار دارم یه جول دسته بندی اخبار
میخوام از هر گروه خبری مثلا 5 تا خبر تو یک باکس نمایش بدم ضمن
اینم Join که زدم اما برای نمایش مشکل دارم
میخوام از هر گروه خبری مثلا 5 تا خبر تو یک باکس نمایش بدم ضمن
اینم Join که زدم اما برای نمایش مشکل دارم
public function getNewsByCat(){ $resault = Database::ArrayQuery(" SELECT n.id AS nid, n.cat_id AS ncat_id, n.owner_id AS nowner_id, n.title AS ntitle, n.description AS ndescrition, n.keywords AS nkeywords, n.visit AS nvisit, n.like AS nlike, n.dislike AS ndislike, n.picture AS npicture, n.create_date AS ncreate_date, n.public_date AS npublic_date, n.update_date AS nupdate_date, n.expire_date AS nexpire_date, n.status AS nstatus, nc.id AS ncid, nc.parent_id AS ncparent_id, nc.owner_id AS ncowner_id, nc.name AS ncname, nc.title AS nctitle, nc.description AS ncdescription, nc.picture AS ncpicture, nc.create_date AS nccreate_date, nc.public_date AS ncpublic_date, nc.update_date AS ncupdate_date, nc.expire_date AS ncexpire_date, nc.status AS ncstatus FROM news n LEFT OUTER JOIN news_categories nc ON nc.parent_id = n.cat_id ORDER BY n.id ASC "); echo count($resault); }