Friday, January 3, 2014

Tute 11 : Show All Data in Home Page From Mysql Database Using php Code



Last tutorial we show only headline from database. Now we will show description our homepage from mysql database. Open the index.php file in notepad++ soft.

Write this code into the body <?php ?> tag after the “$heading=$query_row['heading'];” code :
----------------------------------------------
$details=$query_row['details'];
----------------------------------------------

Again write this code after “echo $heading. '<br>';” code :

----------------------------------------------
echo $details. '<br><br>';
----------------------------------------------


(t-5 p-1)


Save the file and again go to browser and refresh. We see description with headline.
If not ok please check code carefully.

Now we some decorate our post. So write basic html h3 tag into php code on the body.
Write <h3></h3> like this :

echo '<h3>'.$heading.'</h3>';
echo $details. '<br><br>';

We see our home page like this :




No comments :

Post a Comment