PHP a href联盟

PHP a href联盟,php,union,Php,Union,所以我有这个脚本: <?php $query = mysql_query(" SELECT meetup AS text, id AS theID, dato FROM member_meetups WHERE username = '$pusername' UNION SELECT navn AS text, id AS theID, dato FROM member_film WHERE username = '$pusername' UNION SELECT title AS te

所以我有这个脚本:

<?php 
$query = mysql_query("
SELECT meetup AS text, id AS theID, dato FROM member_meetups WHERE username = '$pusername' UNION
SELECT navn AS text, id AS theID, dato FROM member_film WHERE username = '$pusername' UNION
SELECT title AS text, id AS theID, dato FROM member_tutorials WHERE username = '$pusername'
ORDER BY dato DESC
LIMIT 5;
");
while ($row = mysql_fetch_assoc($query)) { echo $row['theID'].' - '. $row['text'] . ' - ' . $row['dato']."<br>"; }
?> 

在站点前面添加一个/或完整的URL,使其成为绝对路径,例如:

/film/show.php?id=$row['id']


添加另一个字段并在链接中使用它:

SELECT "meetup" AS type, meetup AS text, id AS theID, dato FROM member_meetups ...

  ....

echo '<a href="/'.$row['type'].'/show.php?id='.$row['theID'].'">'...
选择“meetup”作为类型,meetup作为文本,id作为id,dato来自成员_meetup。。。
....
回音“”。。。
http://www.example.com/film/show.php?id=$row['id']
SELECT "meetup" AS type, meetup AS text, id AS theID, dato FROM member_meetups ...

  ....

echo '<a href="/'.$row['type'].'/show.php?id='.$row['theID'].'">'...