PHP and mysql help
Hi All I am trying to do an sql query where it links from the index page to the article page using a hyperlink. I have been racking my brain on it for several weeks now and trying to use internet tutorials but i just cant seem to get it working. I will paste the code for the index page and the article page below . Index <?php //Code to connect Database to Site $databaseName='group3'; //Database Name $host='localhost'; //Location of the Database $user='acastio'; //Username $password='default1'; //Password $conn = mysqli_connect($host, $user, $password, $databaseName); if (mysqli_connect_errno($conn)) { echo 'Failed to connect to MySQL: ' . mysqli_connect_error(); } ?> <!DOCTYPE html> <?php include "header.php"; ?> <div> <?php $sql = "SELECT Article.aid, Article.publish_date, Article.author_id, Article.title, Article.body, Article.has_image, User.full_name FROM Article LEFT JOIN User ON Article.author_id = User.uid"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)) { echo "<a href=byline.php?id=" . $row['author_id'] . "><h3>" . $row['full_name'] . "</h3></a><a href=article.php?id=" . $row['aid'] . "><h4>" . $row['title'] . "</h4></a>" . $row['body']; echo $row['author_id']; } $conn->close(); ?> </div> <?php include "footer.php"; ?> Article <?php //Code to connect Database to Site $databaseName='group3'; //Database Name $host='localhost'; //Location of the Database $user='acastio'; //Username $password='default1'; //Password $conn = mysqli_connect($host, $user, $password, $databaseName); if (mysqli_connect_errno($conn)) { echo 'Failed to connect to MySQL: ' . mysqli_connect_error(); } $id = $_GET["id"]; $id = mysqli_real_escape_string($conn,$id); $sql = "SELECT Article.aid, Article.publish_date, Article.author_id, Article.title, Article.body, Article.has_image, User.full_name FROM Article LEFT JOIN User ON Articl