clmowers Posted September 23, 2008 Share Posted September 23, 2008 ok, im going nuts trying to figure this out.what i want to do is have a news page on my web site. I have a mysql server running and a table called news and the table has auto_number, date, headline, news. What i would like to do is have 1 page display the date and the headline and called news.php. When the user click on the headline, query the database and pull the correct info onto the new_page.php page. If possible, i would like to have the whole thing based on a database. Easier to maintain then seperate pages and creating new link every time. Can anyone help me please Quote Link to comment https://forums.phpfreaks.com/topic/125487-php-hyperlink-problemquestion/ Share on other sites More sharing options...
.josh Posted September 23, 2008 Share Posted September 23, 2008 Start with basic database handling, go from there. Quote Link to comment https://forums.phpfreaks.com/topic/125487-php-hyperlink-problemquestion/#findComment-648765 Share on other sites More sharing options...
clmowers Posted September 23, 2008 Author Share Posted September 23, 2008 Hi, thanks for the responce. But i dont that was what i am wanting. I know how to query the database and all that. What i did is create a php page that pull the date and the headline for example 9-23-2008 Microsoft did it again 9-23-2008 Bill did it I created the page so that the Microsoft did it again and bill did it is now a hyperlink using a recordset. what i want to do is when that person click on it, it will pass the Microsoft did it again or bill did it to a page called new_page and display that news line Quote Link to comment https://forums.phpfreaks.com/topic/125487-php-hyperlink-problemquestion/#findComment-648779 Share on other sites More sharing options...
.josh Posted September 23, 2008 Share Posted September 23, 2008 ah okay so just in your links, throw the article's id onto the url target like so... <a href='new_page.php?id=$id'>$title</a> and then on new_page.php just retrieve the id and select the content based on the id $id = $_GET['id']; $sql = "select stuff from table where id = $id"; Quote Link to comment https://forums.phpfreaks.com/topic/125487-php-hyperlink-problemquestion/#findComment-648784 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.