$result = mysql_query("SELECT id, alias, catid, created FROM post_items");
while ($row = mysql_fetch_array($result)) {
echo "http://mysite.com/news/".$row{'айди-категории'}."/".$row{'id'}."-".$row{'alias'}. ;
}
SELECT post_items.id, post_category.alias, post_items.catid, post_items.created FROM post_items
LEFT JOIN post_category ON post_category.id = post_items.catid