在URL中输入mysql_fetch_array项
问题描述:
I have a mysql table I want to echo the name of every user and on click on a certain user show his profile:
$user=mysql_query("SELECT * FROM signup ORDER BY name ASC ");
while($row = mysql_fetch_array($user)){
echo '<a href="profil.php?user='."$row[".username."]".'">'.$row['nume'].' '.$row['prenume']."</a>";
echo "<br>";}
The problem is that i can not figure out how to concatenate $row['username'] with href
The output should look like this: www.abcde.de/profil?user=username
答
Try this
echo '<a href="profil.php?user='.$row['username'].'">'.$row['nume'].' '.$row['prenume'].'</a>';