Im new to PHP
Here is my problem
I have links that are created by querying a Mysql DB. Thes links are the titles of articles. The articles title links to a page that conatins div tags with id's associated with them. Everything workd great. Now my boss wants the articles to display in its own page, I am using an index page with php pages embedded into them like this.
http://www.somesite.org/index.php?page=about
How do I send the variable "article ID" from the links(queried from the database) to another page that queries using " article ID" and then display the title and content in it own page? Basically how do I send the variable of "article ID" through a link and use that variable in a query to extract data from a database?
Would I have to use a form or can I use a link? never seen this before, that's why I am asking. thanks
Using Mysql data that was used on one page to link 2 content
Moderator: General Moderators
-
fernandizo
- Forum Newbie
- Posts: 2
- Joined: Mon Mar 01, 2010 11:55 am
Re: Using Mysql data that was used on one page to link 2 content
Code: Select all
<a href='testedit.php?id=".$info['id'] ."'> ".$info['title'] ."</a>Code: Select all
$id=$_GET['id'];
$data = mysql_query("SELECT * FROM test WHERE id = '$id'") or die(mysql_error());