Hi Dan,
And thank you for your reply.
Unfortunately you need to be quite gentle with me as my SQL skills are limited, though I am fast learner. I sort of understand what you have in mind but I do not seem to be able to make it work.
What I have tried so far is the following (please note that this is my PHP code)
$result = @mysql_query('SELECT userid, catid, id, parent, name FROM jos_cp_fb_moderation INNER JOIN jos_cp_fb_categories ON catid = jos_cp_fb_categories.id WHERE jos_cp_fb_moderation.userid = 617');
$result1 = @mysql_query('SELECT userid, catid, id, parent, name FROM jos_cp_fb_moderation INNER JOIN jos_cp_fb_categories ON catid = jos_cp_fb_categories.parent WHERE jos_cp_fb_moderation.userid = 617');
[/Code]
Rather that running an Alias I thought I would run a separate Query Array $result1 and then I would try to interrogate both. But I am a bit lost in how to cycle through both arrays. The below code is not working.
[Code]
$row1 = mysql_fetch_array($result1);
while ($row = mysql_fetch_array($result)) {
echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<tbody>
<td style="font-size: 14px; font-family: Tahoma; width: 5%;">' . $row['catid'] . '</td>
<td style="font-size: 14px; font-family: Tahoma; width: 25%;">' . $row['name'] . '</td>
<td style="font-size: 14px; font-family: Tahoma; width: 5%;">' . $row['parent'] . '</td>
<td style="font-size: 14px; font-family: Tahoma; width: 25%;">' . $row1['name'] . '</td>
<td style="font-size: 14px; font-family: Tahoma; width: 40%;"></td>
</tbody>
</table>';
}
[/Code]
I know that this isn't the approach you suggested but your comment made me think of trying this.
As this hasn't worked, I was wondering if you can be a bit more specific in detailing how exactly I should make the additional JOIN with the ALIAS. I know that you have given me the code as well but unfortunately I am not quite able to work out how to apply it to my PHP/SQL scenario. Basically what I am asking is
1) Do I need to run a separate $resultx SELECT ?
or
2) Can I combine both SELECT/JOINS in the same $result ?
Thanks heaps for all your help,
Adri