What I have is a menu with links. What I want to happen is when clicked, information for that page is displayed on the index page. So, for example, clicking About.php, will add about page text from a database to a tag in the page.
I have this menu (code):
<?php
$stmt = $pdo->query("SELECT * FROM testtable01");
while ($row = $stmt->fetch()) {
echo "<td class='navItem'>" . "<a href='index.php'>" . $row['testmenu1']. "</a>" . "</td>";
}
?>
In the same page, I have the place where I want the text to appear:
<?php echo $row['testsubmenu1']; ?>
I understand that this gives an error message " Trying to access array offset on value of type bool in C:\xampp\htdocs\Testpage\index.php", but this may be part of what I am not doing, so any help in getting text from database using page id to a tag will be appreciated.