PHP Pages Won't Load

Hi All

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>';
  }
  

Well I am assuming the link you are clicking is in index.php correct? (in other words that is the code above)?

If so where are you outputting the new pages content? You are either not showing the rest of the code or there is a LOT of code missing here

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?

<?php 
			echo '<h1>' . $row_news['page_title'] . '<h1>';
		    echo $row_news['page_text'];
		?>