PHP query issue

Associate
Joined
29 Mar 2006
Posts
3
Hi,

Im currently learning PHP with a little help ;)

But this is probably my rubbish database layout, but i am needing a query that gets article id's out of a table, which it is happening, but i need to order this by date which is located in another table.

Query i have at the moment
$result = @mysql_query("SELECT idcat, idinfo FROM news_link WHERE idcat='$sectionid'");


Database Structure:
-----
news_link:

id (primary) | idinfo (foreign) | idcat
-----
news_info:

id (primary) | title | news | date | author | active
-----

id in the news_info table is the same as idinfo in the news_link table


Any more info requred please reply,

thanks in advance

daniel
 
Last edited:
Dj_Jestar said:
Code:
SELECT `news_link`.`idinfo`, `news_link`.`idcat` 
FROM `news_link`
LEFT JOIN `news_info` 
ON `news_link`.`idinfo` = `news_info`.`id`
ORDER BY `news_info`.`date`;
where abouts would i put WHERE idcat = $sectionid ?

thanks for the help so far
 
Back
Top Bottom