[英]How to add link to mysql database record as a <html> href?
if($rezultat = $polaczenie->query($sql))
$ilu_userow = $rezultat->num_rows;
while($ilu_userow>0){
$wiersz = $rezultat->fetch_assoc();
$id = $wiersz['id'];
$like = $wiersz['likes'];
$price = $wiersz['price'];
echo '<div class="pozycja">
<span>
<h1><font color="blue"/> '
. $id . ' </h1></font><font color="red"/> '
. $like . ' </font><h2><strong><font color="green"/> '
. $price . '</h2></strong></font></span></div>';
$ilu_userow = $ilu_userow - 1;
}
This is my code, and - as in the topic - i want to create html adress to every row i get from my database, and the question is - how? 这是我的代码,并且-正如本主题中一样-我想为从数据库中获取的每一行创建html地址,而问题是-怎么样?
if($rezultat = $polaczenie->query($sql)) $ilu_userow = $rezultat->num_rows; while($ilu_userow>0){
$wiersz = $rezultat->fetch_assoc();
$id = $wiersz['id'];
$like = $wiersz['likes'];
$price = $wiersz['price'];
echo '<div class="pozycja">
<span>
<h1><font color="blue"/> '
. $id . ' </h1></font><font color="red"/> '
. $like . ' </font><h2><strong><font color="green"/> '
. $price . '</h2></strong></font></span>';
//added line start
echo '<a href="file.php?id='.$id.'">'.$id.'</a>';
echo '</div>';
//added line end
$ilu_userow = $ilu_userow - 1; }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.