PHP mulitdimensional array from mySQL query?

I’m a noob to PHP and MySql, and have been going through various tutorials and sites, trying to learn a bit, and need a bit of help. I’ve got a database of articles built with 3 tables, Articles2006, ArticleType, ArticleDevReference.

What I’m doing is pulling a list of articles, some are news, some are editorial, and some are neighborhood specific. What I want to do is pull all of the information in one query, and then place the news headlines and links in one place on the page, the editorial headlines and links on another,and the neighborhood specific in a third.

I think I need to create a multidimensional array, but I don’t have a clue where to start…can anyone help? Or is this not what I need?

from the query shown below, ATypeID is a foreign key which identifies what type of article it is (news, editorial). ADevID is a foreign key which identifies if the article is neighborhood specific or not. if yes, it Identifies the neighborhood. ATitle is obviously the title of the article, AURL is the url to linke the title to.

//connect to database 
$connection = mysql_connect("localhost", "name", "password") or die("Error connecting to database");
mysql_select_db("databasename", $connection);
$result = mysql_query("SELECT DISTINCT Articles2006.ATypeID, ATitle, AURL, ADevID
    FROM Articles2006, ArticleType, ArticleDevReference
    ORDER BY ATitle DESC", $connection) or die("error querying database");
$i = 0;
while($result_ar = mysql_fetch_assoc($result)){ 
    echo $result_ar['ATitle'];

If there’s a better way to do this, then please let me know! thanks in advance…