Hello!
Can someone help me work out the following - hopefully the code below will sort of explain itself as to what I'm trying to do?
I want to:
SELECT * FROM messageboard_links WHERE fatherid = '0' ORDER BY ?????????
Ordered by the results of this query:
SELECT id FROM messageboard_links WHERE fatherid != '0' AND categoryid = '$categoryid' ORDER BY date DESC
This is what I've got so far, but obviously the order by isn't working (or I wouldn't have to ask :) )
$query = "SELECT * FROM messageboard_links WHERE fatherid = '0' ORDER BY ( SELECT id FROM messageboard_links WHERE fatherid != '0' AND categoryid = '$categoryid' ORDER BY date DESC )";
Any ideas?
r
Can someone help me work out the following - hopefully the code below will sort of explain itself as to what I'm trying to do?
I want to:
SELECT * FROM messageboard_links WHERE fatherid = '0' ORDER BY ?????????
Ordered by the results of this query:
SELECT id FROM messageboard_links WHERE fatherid != '0' AND categoryid = '$categoryid' ORDER BY date DESC
This is what I've got so far, but obviously the order by isn't working (or I wouldn't have to ask :) )
$query = "SELECT * FROM messageboard_links WHERE fatherid = '0' ORDER BY ( SELECT id FROM messageboard_links WHERE fatherid != '0' AND categoryid = '$categoryid' ORDER BY date DESC )";
Any ideas?
r