After connect php website and database,we will try to get the content from the database,we can create a page which is called content.php.
And we just need to put this code in the <body> </body> part.
<?php
$query_subjects = “SELECT * FROM subjects”;
$query = mysql_query($query_subjects);
if(!$query) {
die(”Database selection failed: ” . mysql_error() );
}
//so we just have get the content from the database subjects table,now we need to display the content on the website.
while($ subject_row = mysql_fetch_array($query)) {
echo $row[menu_name] ;
}
?>
It will get all the meun_name from the database and it will display on your website.
Leave a comment
You must be logged in to post a comment.