sabret00the
01-14-2005, 05:34 PM
can someone tell me why this thing refuses to do it's job for me please
// ###################### query for posts
$posts = $DB_site->query("
SELECT grps_post.postid, grps_post.groupid, user.username AS poster, user.userid, grps_post.title AS posttitle, grps_post.dateline, grps_post.pagetext AS message, grps_post.iconid, icon.title AS icontitle, icon.iconpath, grps_post.visible, usertextfield.*
FROM grps_post
LEFT JOIN user ON (user.userid = grps_post.userid)
LEFT JOIN usertextfield ON (usertextfield.userid = user.userid)
LEFT JOIN grps ON (grps.groupid = grps_post.groupid)
LEFT JOIN icon ON (icon.iconid = grps_post.iconid)
WHERE grps_post.groupid = $groupid AND grps_post.visible != 0
GROUP BY grps_post.groupid
ORDER BY grps_post.dateline DESC
");
$cell = 0;
if ($DB_site->num_rows($posts))
{ // display the information
while ($post = $DB_site->fetch_array($posts))
{
$cell++;
$template = iif($post['isdeleted'], "postbit_deleted", "groups_viewthread_postbit");
$postbit = construct_postbit($post, $template);
} //got all that info
}
// ###################### query for posts
$posts = $DB_site->query("
SELECT grps_post.postid, grps_post.groupid, user.username AS poster, user.userid, grps_post.title AS posttitle, grps_post.dateline, grps_post.pagetext AS message, grps_post.iconid, icon.title AS icontitle, icon.iconpath, grps_post.visible, usertextfield.*
FROM grps_post
LEFT JOIN user ON (user.userid = grps_post.userid)
LEFT JOIN usertextfield ON (usertextfield.userid = user.userid)
LEFT JOIN grps ON (grps.groupid = grps_post.groupid)
LEFT JOIN icon ON (icon.iconid = grps_post.iconid)
WHERE grps_post.groupid = $groupid AND grps_post.visible != 0
GROUP BY grps_post.groupid
ORDER BY grps_post.dateline DESC
");
$cell = 0;
if ($DB_site->num_rows($posts))
{ // display the information
while ($post = $DB_site->fetch_array($posts))
{
$cell++;
$template = iif($post['isdeleted'], "postbit_deleted", "groups_viewthread_postbit");
$postbit = construct_postbit($post, $template);
} //got all that info
}