<?
$sql = dbquery("SELECT `id`, `title`, `description` FROM `content` LIMIT 0,12 ");
while ($row = mysql_fetch_array($sql)) {
$id = $row["id"];
$title = $row["title"];
$description = $row["description"];
$content = '
<div class="description-box">
<p>page id: ' . $id . '</p>
<p>' . $title . '</p>
<p>' . $description . '</p>
</div>';
}
echo $content;
?>
// 注意: div class="description-box"
// 3 つの出力 div ごとに div class="description-box nopadding" に置き換えるにはどうすればよいですか?
HTML 生成コードの例:
<div class="description-box nopadding">
// content
</div>
<div class="description-box">
// content
</div>
<div class="description-box">
// content
</div>
<div class="description-box">
// content
</div>
// 次に、再び div をnopadding