This is litle complicated query for me, but if anyone have idea please post id...
I want to make something like this
SITE 1
post
post
post
SITE 2
post
post
post
here is my query
$result = mysql_query("SELECT content.* FROM content WHERE content.site IN
(SELECT site_id FROM site_subscription WHERE user_id = ".$_SESSION['userid'].")
ORDER by content.site DESC");
while($row = mysql_fetch_assoc($result)) {
$array[] = $row;
}
AND im display post
if(is_array($array)) {
foreach($array as $row) {
include($basepath.'/template/item.php');
}
}
This is working and post is sorted by site_id, but need to get site_name from other table, table name site and than GROUP post by site_name like above SITE 1, SITE 2, SITE 3
Something like
SELECT * FROM site WHERE id='content.site'