Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6105655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:59:39+00:00 2026-05-23T13:59:39+00:00

I am here to open a new line after every 6 from the data

  • 0

I am here to open a new line after every 6 from the data that I want to draw the line data.
When the 6-like following code prints the data 36 times.
that this function is checking how many games. If I mention below, but as there are now 36 with 6 printing units. Each one of the prints 6 times.

for($i = 0; $i < $db->oyunSayisi(); $i++)
{ 
    if ($i % 6 == 0)
    {
        echo "<tr>";
    }

    ?>
    <br/>
    <?php
    foreach($db->oyunCek() as $oyun)
    {
        ?>
        <td width="224" height="115"><a href="<?=$db->siteAdres()?>/oyun.php?id=<?=$oyun['o_id']?>" title="<?=$oyun['o_baslik']?> oyna"><img height="115;110" src="<?=$db->siteAdres()?>/resimler/<?=$oyun['o_resim']?>" title="<?=$oyun['o_baslik']?> oyna" alt="<?=$oyun['o_baslik']?> oyna" /></a></td>
        <?php
    }
    if ($i % 6 == 0)
    {
        echo "</tr>";
    }
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:59:40+00:00Added an answer on May 23, 2026 at 1:59 pm

    I think I see what may be causing the problem.

    For every sixth item returned from oyunSayisi(), you want to create a table row that shows the data from oyunCek(). The problem is that the first modulus just outputs <tr>, then every line runs the foreach loop. Finally, the second modulus outputs </tr>. I think you want to combine everything into just one modulus, like this:

    for($i = 0; $i < $db->oyunSayisi(); $i++)
    { 
        if ($i % 6 == 0)
        {
            echo "<tr><br/>\n";
            foreach($db->oyunCek() as $oyun)
            {
                ?>
                <td width="224" height="115"><a href="<?=$db->siteAdres()?>/oyun.php?id=<?=$oyun['o_id']?>" title="<?=$oyun['o_baslik']?> oyna"><img height="115;110" src="<?=$db->siteAdres()?>/resimler/<?=$oyun['o_resim']?>" title="<?=$oyun['o_baslik']?> oyna" alt="<?=$oyun['o_baslik']?> oyna" /></a></td>
                <?php
            }
            echo "</tr>\n";
        }
    } 
    

    EDIT:

    Upon further pondering, it did not make sense that you would want to only echo every sixth line of data… so it occurred to me that you are probably trying to create a new table row every sixth line, rather than skipping any of the inner foreach loops. Here is the modified code to do that:

    echo "<tr>\n";
    for($i = 0; $i < $db->oyunSayisi(); $i++)
    {
        foreach($db->oyunCek() as $oyun)
        {
            ?>
            <td width="224" height="115"><a href="<?=$db->siteAdres()?>/oyun.php?id=<?=$oyun['o_id']?>" title="<?=$oyun['o_baslik']?> oyna"><img height="115;110" src="<?=$db->siteAdres()?>/resimler/<?=$oyun['o_resim']?>" title="<?=$oyun['o_baslik']?> oyna" alt="<?=$oyun['o_baslik']?> oyna" /></a></td>
            <?php
        }
        if (($i + 1) % 6 == 0)
        {
            echo "</tr>\n<tr>\n";
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having this code: using (BinaryWriter writer = new BinaryWriter(File.Open(ProjectPath, FileMode.Create))) { //save something here
So, first off here's my code to open the dotx and create a new
Related to my question here but not enough to open a new question. I
My goal here is to open temp.php, explode by ### (line terminator), then by
Here's my code: // Open modal window with links $('.links').colorbox({speed:100, opacity:0.75, html:'<div id=links-colorbox><h2>Download links</h2><textarea
I have application reads in data from text file. Recently I realized that I
I would like to open another swing gui after clicking a button and I
I have a Runnable that gets a line to the Mic, reads from it
So here is the bit of my code that's giving me problems: void childProcessHandler(string
I am not exactly sure what's happening here - I open a terminal window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.