I am suck on some code here. It displays an article as a result of clicking on a link from another page displaying title and content etc.
My issue is I need a different record set to appear on the page as well what is here.
In this case it would be a list of all the other titles which have the same ‘artcampaign’ number as the article loaded. Kind of like a related articles or full list within this category. Any help appreciated with this.
$sql = "
SELECT articles.id AS articleid, articles.art_title AS title, articles.art_url AS art_url, articles.art_content AS content, campaigns.id, campaigns.camp_title AS camptitle, campaigns.camp_name AS campname, campaigns.camp_url AS camp_url
FROM articles
LEFT JOIN campaigns ON articles.art_campaign = campaigns.id
WHERE art_url = ?";
$stmt = $db->prepare($sql);
$stmt->bind_param('s', $_GET['art_url']); // assuming it's a string?
$results = $stmt->execute();
echo "
<h2>{$campname}</h2>
<H3>{$camptitle}</H3>
<H4>{$title}</H4>
";
?>
<div class='right-section'>
<h5><?php echo "{$campname}"; ?> Links</h5>
<ul calss='section-list'>
<li>dummy text</li>
</ul>
</div>
<?php echo "{$content}"; ?>
</div>