Here is the continuation of the News article tutorial in php…. The first part of the article finishes with the inserting the values from the form into database Now we are going to retrieve the data from the database and we have to display that in a separate page.
I already mention about two php files that we are used in the program one is post.php and the other one is news.php where we have used post.php for form design and inserting the values in the database.
Now create a php page in dreamweaver or anyother editor tha you are comfortable with,save it as news.php
Below is the code for retrieving the data from the database
mysql_connect(“localhost”,”root”,””) or die(mysql_error());
$news=mysql_query(“SELECT * FROM news”);
//Retrieving values of all records using while loop
$title posted on $date<br>
I think there is nothing to explain with the code where you can get from my previous posts or frommy comment line used in the code.If any doubts feel free to contact me….<hr> is the new tag used for creating horizontal row in your page after each news fetched from the database.