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 600505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:36:47+00:00 2026-05-13T16:36:47+00:00

hey guys , i know this is a stupid question but i hanged in

  • 0

hey guys , i know this is a stupid question but i hanged in solving it

i wrote a block of php code to show images from mysql

    echo "<table><tr> ";

    while($cat = $db->sql_fetchrow($catinfo)) {
        echo '
        <td>
        <ul id="three-col" class="press">   
        <li>
    <div class="post-content">
    <a class="zoom1" href="'.$galsettings[setImgDir].'/'.$cat[galCatLocation].'/'.$cat[galCatImg].'">
    <img src="'.$galsettings[setImgDir].'/'.$cat[galCatLocation].'/'.$cat[galCatImg].'" alt="artistry (via powerbooktrance)" />
    </a>
    </div>';

    for ($i=0; $i>2; $i++) {
    echo "</tr><tr>";
    }
    }

echo "</li></ul></td></tr></table>";

but with this code everything goes wrong and it doesnt break after each 3 images in row

i even used

if ($i>2) {
    echo "</td></tr><tr>";
}

but as u know it only breaks the tr after image number 3 not every row

im really sorry for my foolish question

  • 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-13T16:36:48+00:00Added an answer on May 13, 2026 at 4:36 pm

    Try this:

    echo "<table><tr> ";
    
    $counter = 0;
    
    while($cat = $db->sql_fetchrow($catinfo)) {
    
        $counter++;
    
        echo '
        <td>
        <ul id="three-col" class="press">   
        <li>
        <div class="post-content">
        <a class="zoom1" href="'.$galsettings[setImgDir].'/'.$cat[galCatLocation].'/'.$cat[galCatImg].'">
        <img src="'.$galsettings[setImgDir].'/'.$cat[galCatLocation].'/'.$cat[galCatImg].'" alt="artistry (via powerbooktrance)" />
        </a>
        </div>
        ';
    
        if ( $counter == 3 ) {
    
            echo '</tr><tr>';
    
            $counter = 0;
        }
    
    }
    
    echo "</li></ul></td></tr></table>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys - I know this is not a strictly programming question but I'm
Hey guys I feel like this is a simple question, but I don't know
Hey guys, I don't know if this question has been asked yet but imagine
hey guys i know this may sound stupid, but i am stuck with this
Hey guys this is a snippet of my current code. I want to know
Hey guys I know that this is probably just a simple sql statement but
Hey guys I know this is an old issue but I am wondering if
hey guys, i know it's not the best way of doing this but the
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
hey guys having this really simple problem but cant seem to figure out have

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.