Fetching Column Items from DB and Creating Hyperlink in PHP

I was trying to write a script on php that will be something like the moving bar of the ‘news websites’ where headlines are available. I did it, and here it goes for making it available for those people who needs it in future around the globe 😀 (sounds its poor work to shout, isn’t? LOL I know!) 😉

Let, I have a database named “news” and I want to show the news headlines in a box of the website like under the header. now, I have a table named “table_news”. I need to show the titles (headlines) of the news in descending order. moreover, I want that that when I will link on it, I will go to that specific news. So, a hyper link is needed to set on that HEADLINE thing.

In my case, the ID is a column and unique, auto-incremented. and the link of the respective news is like site.com/postid=ID. So I need to fetch the ID from the db and to set the HEADLINE’s ID on the text of the moving bar.
Continue reading “Fetching Column Items from DB and Creating Hyperlink in PHP”