如何通过php在两个mysql表之间创建超文本链接

First of all, sorry because I'm not sure if the question I'm doing has to do with what is called "relations" in mysql (I'm not an expert).

Well the thing is that from a PHP I do a query to call a table stored at a mysql db, let's say:

+-------+-----+
|NAME   |YEAR |
+-------+-----+
|Ana    |1990 |
|John   |1987 |
|Jane   |1992 |
+-------+-----+

and I have a second table in mysql, let's say this one:

+-------+----------+
|NAME   |CITY      |
+-------+----------+
|Ana    |Barcelona |
|John   |Santiago  |
|Jane   |La Habana |
+-------+----------+

so what I need to do is, at the first table that I see through PHP, have the name clickable so if I click Ana, obtain at a second PHP page:

"Ana is in Barcelona"

Sorry if I'm too naive to express myself.

You need to load the first set of data through a MySQL query, then create a link to a second page (by either posting or getting the variables) to lookup the next set of data.

Simple MySQL queries, really.

While printing Anna in page1, make a link to page2 and send Anna using GET.
Make link as <a href=page2.php?name=Anna>Anna</a>. This data is available to page2 and can be accessed using the GET global array as $_GET['name'].Now you can create your query easily.

You can use JOIN in the query you display the first results:

SELECT myFirstTable.name, myFirstTable.year, mySecondTable.city FROM myFirstTable LEFT JOIN ON mySecondTable.name=myFirstTable.name WHERE 1

Then on your php you can assign the third result to the page you want to show.