我有一个网站,谷歌批准了我的广告帐户。我的站点有从数据库循环的行。我想将Goo广告的每一行都放在while ($row = mysqli_fetch_array($result)) {
echo "<fieldset>
my row here
</fieldset>";
}
标记
<fieldset1>
my row here from DB
<endfieldset1>
<fieldset2>
GOOGLE ADS
<endfieldset2>
<fieldset3>
my row here from DB
<endfieldset3>
<fieldset4>
my row here from DB
<endfieldset4>
例如:
select("t")
答案 0 :(得分:0)
这是一个很愚蠢的解决方案,但它可能适用于您想要的东西。
<?php
$counter = 0;
while ($row = mysqli_fetch_array($result)) {
// Echo your normal stuff here
if ($counter == 5) {
// Echo your add here and reset the counter
$counter = 0;
}
$counter++;
}
?>
所以一旦计数器到达器5显示您的添加并将其重置为0