2012-05-29, 09:51 AM
I want to use a query in mybb_posts & attachment
for now i am using
But this code is selecting all rows (duplicate & non-duplicate) I want to select only non-duplicate rows, how to do that ?
for now i am using
<?
<?
//2nd while loop
$queryy=mysql_query("SELECT
mybb_posts.pid, mybb_posts.subject,mybb_posts.message,mybb_posts.tid,
mybb_attachments.pid,mybb_attachments.aid
FROM mybb_posts
INNER JOIN mybb_attachments
USING(pid,pid)
ORDER BY `aid` DESC
LIMIT 7")or die($query."<br/><br/>".mysql_error());
while ($lista=mysql_fetch_array($queryy))
{
echo '
<img src="attachment.php?aid='.$lista["aid"].' " alt="" />
<h4><a href="#" >'.$lista["subject"].'</a></h4>
';
}
?>
But this code is selecting all rows (duplicate & non-duplicate) I want to select only non-duplicate rows, how to do that ?