Insert line break after every two rows of database

前端 未结 6 1278
清酒与你
清酒与你 2021-01-16 08:31

I have a little script that prints a certain amount of rows in a mysql database.

Is there any way to make it so that after every second row it prints, ther

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-16 09:22

    Depending on the language, something like this should do it: (in php) (where $arr is an array of results)

    $str = '';
    $i = 0;
    
    for ($i=0; $i';
       }
       else
       {
          $str .= $arr[$i];
       }
    }
    
    echo $str;
    

提交回复
热议问题