如果我添加此引導標籤成HTML代碼,它完美的作品:無法添加引導選項卡爲PHP代碼
<ul class="nav nav-tabs">
<li class="active"><a href="#hello" data-toggle="tab">Hello</a></li>
<li><a href="#empty" data-toggle="tab">Empty</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="hello">
<h3>Hello my Friend!</h3>
<p>hello</p>
</div><!-- @end #hello -->
<div class="tab-pane" id="empty">
<h3>Just gonna be empty...</h3>
<p>Yup. Nothin' here.</p>
</div><!-- @end #empty -->
</div>
不過,在這些自來水,我需要連接到我的數據庫,所以顯示的一些信息,我代碼是:
<ul class="nav nav-tabs">
<li class="active"><a href="#facilities" data-toggle="tab">Facilities</a></li>
<li><a href="#fee" data-toggle="tab">Course Fee</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="facilities">
<h3>Just gonna be empty...</h3>
<p>Yup. Nothin' here.</p>
<?php echo "<table>";
$userpic = '<img src="images/user.png"/>';
while ($roww = mysqli_fetch_array($usercomment)){
$cm_fac = $roww['facilities'];
$name = $roww['UserName'];
$time = $roww['CmtDate'];
echo '<tr>';
echo '<td>';
//i put some info here as table
echo '</td>';
echo '</tr>';
}
echo "</table>";
?>
</div><!-- end of facilities-->
<div class="tab-pane" id="fee">
<h3>Hello my Friend!</h3>
<p>hello</p>
<?php echo "<table>";
$userpic = '<img src="images/user.png"/>';
while ($roww = mysqli_fetch_array($usercomment)){
$cm_fee = $roww['fee'];
$name = $roww['UserName'];
$time = $roww['CmtDate'];
echo '<tr>';
echo '<td>';
//some info here too
echo '</td>';
echo '</tr>';
}
echo "</table>";
?>
</div><!-- end of fee-->
</div> <!--end of tab-content-->
但它不起作用。任何人都可以告訴我我的問題? 謝謝你的時間。
? nósai 1cáilànóchỉlấyđcdataphầnđầutiênthôi(tứclàdatamìnhlấytr ongvòngwhilethứnhất),phầncònlạinókolấyđc,dùmìnhđãđổitênrồi。 – dzuncoi 2014-10-08 06:06:58
您需要在代碼中添加其他查詢。例如:'$ sql = query \t echo「
data 1
」; \t while($ rows = mysqli_fetch_array($ sql,MYSQLI_ASSOC)){ \t \t $ name = $ rows ['page']; \t \t \t \t echo「」。 $名稱。 「」; \t} \t \t echo「data 2
」; \t $ SQL1 =查詢 \t而($行= mysqli_fetch_array($ SQL1,MYSQLI_ASSOC)){ \t \t $名稱= $行[ '頁']; \t \t $ id = $ rows ['id']; \t \t echo「」。 $ id。 「」; \t \t echo「」。 $名稱。 「」; \t} \t mysqli_close($ con);' – TriMinh 2014-10-08 06:27:09đượcrồi,cảmơnbạnnhiềunhé:) – dzuncoi 2014-10-08 06:42:04