我正在尝试制作一个显示某人所有朋友的手风琴(twitter bootstrap),我最终只是创建了一个无限循环,基本上我要做的就是为结果中的每一行回显一个 php 字符串。
谁能发现我在做什么愚蠢(除了不使用mysqli)?
while ( $rowresult = mysql_fetch_assoc(mysql_query("SELECT * FROM friends WHERE id='".$user["ID"]."' ")) ) {
$auto = "0px";
echo '<div class="accordion-group"><div class="accordion-heading"><div class="accordion-heading">';
echo '<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse'. $counter . '">';
echo $rowresult['firstname'];
echo ' ';
echo $rowresult['lastname'];
echo ', ';
echo $rowresult['headline'];
echo '</a></div> <div id="collapse'. $counter .'" class="accordion-body ';
if ($counter == 0){
echo 'in ';
$auto = "auto";
}
echo 'collapse" style="height: '. $auto .'; "><div class="accordion-inner">';
echo '<img src="'.$rowresult["pictureUrl"].'">';
echo '</div></div></div></div>';
$counter++;
}