我是Bootstrap的新手,并尝试为我的数据库中的每条记录创建一个唯一的数据目标名称。可以在Bootstrap中完成吗?
我的代码如下所示:
$i = 0;
while($row=mysql_fetch_array($result, MYSQL_ASSOC))
{
ob_start();
echo "
<div class='container'>
<div class='row features container-fluid'>
<div class='row'>
<div class='well-sm'>
<div class='thumbnail'>
<div class='caption'>
Name: $tempname</br>
<button type='button' class='btn btn-sm btn-info'
data-toggle='collapse' data-target='#demo[$i]'>
click for details</button>
<div id='demo[$i]' class='collapse'>$tempdescription</div>
</div>
</div>
</div>
</div>
</div>
</div>
";
$classdata = ob_get_contents();
ob_end_clean();
$i++;
?>
<div class="more-less">
<div class="more-block">
<?php echo $classdata ?>
</div>
</div>
<?php
}