我在将选定行中的数据显示到另一个 div 时遇到问题。
这意味着我正在显示例如名字和姓氏,当用户单击名称(作为链接)时,我想显示来自所选 Id 的更多数据,并且我希望它显示在下面的 div 框中。
请参阅此处的网站:http: //kristoff.it/onlinecoaching/
我的代码:
<div class="greenBox1">
<h1>1 - VÆLG DIN ONLINE COACH</h1>
<div class="whiteBox1">
<?php
$sql = "SELECT * FROM coach ";
$coachId = $row["coachId"];
$fornavn = $row["fornavn"];
$efternavn = $row["efternavn"];
$result = mysql_query($sql);
while($row=mysql_fetch_assoc($result))
{
echo '<table border="0" align="left" height="100">';
echo '<tr>';
echo '<td width="95" rowspan="2" align="center" valign="middle"><img src="' . $row['imgUrl'] . '" width="85" height="85" alt="' . $row['imgAlt'] . '"/>' . '</td>';
?>
<!-- here I'm trying to write the id of the selected name to the div box below -->
<?
echo '<td><a href="' . $coachId . '" target="whiteBox2"><h2>' . $row['fornavn'] . $row['efternavn'] . '</h2></a></td>';
echo '</tr>';
echo '<tr>';
echo '<td valign="top" width="190"><p>' . $row['beskrivKort'] . '<br></p></td>';
echo '</tr>';
echo '</table>';
}
?>
</div>
</div>
<div class="greenBox2">
<h1>2 - BOOK TID I COACHENS KALENDER</h1>
<div class="whiteBox2" id="whiteBox2">
<!-- here would like the more data to show -->
</div>
</div>
问候玛丽亚