如何在通过 MYSQL 的变量上提供多个链接。在下面的链接中,用户名正在获取通用链接。我想为个人用户名使用相应的链接。
例如 http://www.bahrainmedicalbulletin.com/output2.php
PHP 脚本
<html>
<body>
<?php
$username="username";
$password="password";
$database="database";
$localhost = "localhost";
mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM people";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table border="1" bordercolor="#000000" cellspacing="2" cellpadding="5">
<tr>
<td><font face="Arial, Helvetica, sans-serif">ID</font></td>
<td><font face="Arial, Helvetica, sans-serif">Full Name</font></td>
<td><font face="Arial, Helvetica, sans-serif">Telephone</font></td>
<td><font face="Arial, Helvetica, sans-serif">Birthday</font></td>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"id");
$f2=mysql_result($result,$i,"name");
$f3=mysql_result($result,$i,"telephone");
$f4=mysql_result($result,$i,"birtday");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif">**<?php echo "<a href=\"riz_ritz.png\">{$f2}</a>"; ?>**</font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
</tr>
<?php
$i++;
}
?>
</body>
</html>