如何修复我的PHP代码或谷歌广告,在db循环的行之间显示广告
我有一个网站,谷歌批准了我的广告帐户。我的站点有从DB循环的行。我想把每一行Goo广告放在如何修复我的PHP代码或谷歌广告,在db循环的行之间显示广告,php,html,mysqli,ads,Php,Html,Mysqli,Ads,我有一个网站,谷歌批准了我的广告帐户。我的站点有从DB循环的行。我想把每一行Goo广告放在字段集标记中 while ($row = mysqli_fetch_array($result)) { echo "<fieldset> my row here </fieldset>"; } while($row=mysqli\u fetch\u数组($result)){ 回声“ 我这一排 "; } 例如: <fieldset1> my row here fro
字段集
标记中
while ($row = mysqli_fetch_array($result)) {
echo "<fieldset>
my row here
</fieldset>";
}
while($row=mysqli\u fetch\u数组($result)){
回声“
我这一排
";
}
例如:
<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>
我在DB的这一行
谷歌广告
我在DB的这一行
我在DB的这一行
这是一个相当愚蠢的解决方案,但它可能适用于您想要的tbh
<?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显示您的实际代码,而不是伪代码。