I have two tables, "custom_droplinks_cat" and "custom_droplinks".
Below is the tables' layout. I hope it is easy to understand.
Code:
----------------------------------------
| Table: custom_droplinks_cat
----------------------------------------
| catid: 1
| title: Test Category 1
----------------------------------------
| catid: 2
| title: Test Category 2
----------------------------------------
----------------------------------------
| Table: custom_droplinks
----------------------------------------
| linkid: 1
| title: Test Link 1
| catid: 1
----------------------------------------
| linkid: 2
| title: Test Link 2
| catid: 1
----------------------------------------
| linkid: 3
| title: Test Link 4
| catid: 2
----------------------------------------
| linkid: 4
| title: Test Link 4
| catid: 2
----------------------------------------
I don't want to ask more than I need to so I'll just ask "How do I make "Test Category" bold then place "Test Link" immediately after followed by a break (br />)?
PHP Code:
$getdroplinks_cat = $db->query_read("SELECT
droplink_cat.catid as dlc_catid,
droplink_cat.title as dlc_title,
droplink.catid as dl_catid,
droplink.title as dl_title,
FROM " . TABLE_PREFIX . "custom_droplinks_cat AS droplink_cat
LEFT JOIN " . TABLE_PREFIX . "custom_droplinks AS droplink ON (droplink_cat.catid=droplink.catid)
WHERE droplink_cat.catid = droplink.catid ");
while($dlink = $db->fetch_array($getdroplinks_cat))
{
echo "<b>".$dlink['dlc_title']."</b><br />
".$dlink['dl_title']."<br /><br />";
}
I want the result to be
Code:
Test Category 1
Test Link 1
Test Link 2
Test Category 2
Test Link 3
Test Link 4