I’m trying to connect to pages using the data inside a database, I’ve created the table, connections and all of that works fine the only problem I’m having is it won’t load the pages when I click on the links, I’ve chosen a page I want it to go to, but how do I get it to show the new page.
Here is the code below:
<?php
$connect = require_once('connections/config.php');
//Connect to mysql server
$link = mysql_connect($hostname_ilikeyours, $username_ilikeyours, $password_ilikeyours);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db($database_ilikeyours);
if(!$db) {
die("Unable to select database");
}
$result = mysql_query("SELECT * FROM co_pages");
while($row = mysql_fetch_array($result))
{
echo '<ul>';
echo '<li><a href=index.php?page_id='. $row['page_id'] .'>' . $row['page_title'] . "</a></li>";
echo '</ul>';
}
Yes the code above is from index.php, further on down I’ve written these two lines? How this just outputs the index text and when the links are clicked it doesn’t change?