Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Trying to include a pages using a database

$
0
0

Hi All

 

Thanks for looking.

 

I am trying to include individual pages to appear on a page with each page name in a database. When I put the include page it shows it exact but what I would like to do is have the pages included in the main page.

 

Here is the code i have used

include 'config.php';
$query = "SELECT * FROM `hotel`ORDER BY RAND()";		
$result = mysql_query ($query); // Run the query.
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
	echo '
	    <h2>' . $row['name'] . '</h2>
		<p> '. $row['page'] . '</p>
	';
}

;

mysql_free_result ($result); // Free up the resources.	

mysql_close();

row page being each subjects individual page. 

 

Thanks for looking


Viewing all articles
Browse latest Browse all 13200

Trending Articles