Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何修复我的PHP代码或谷歌广告,在db循环的行之间显示广告_Php_Html_Mysqli_Ads - Fatal编程技术网

如何修复我的PHP代码或谷歌广告,在db循环的行之间显示广告

如何修复我的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

我有一个网站,谷歌批准了我的广告帐户。我的站点有从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 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

显示您的实际代码,而不是伪代码。