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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:34:38+00:00 2026-05-25T10:34:38+00:00

This is my dynamicList (one of you helped me to create multiple columns in

  • 0

This is my dynamicList (one of you helped me to create multiple columns in it.)
But I forgot that by creating multiple columns/rows inseide a table, if I have 20 items to be displayed, I have to wait until the whole table is ready, and I don’t want that.

How can I fix it so it displays each row inside a new table?

if ($productCount > 0) {
        $i=0;
        $dynamicListBody = '<table width: 90%; margin-right: auto; margin-left: auto; color: #00E6AA;>';
        while($row = mysql_fetch_array($sql)){
            $id = $row["id"];
            $product_name = $row["product_name"];
            $details = $row["details"];
            $price = $row["price"];
            $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
        $dynamicListBody .= ($i==0) ? '<tr>':'';
        $dynamicListBody .= '<td width="10%">
                    <img style="border:#666 1px solid;" src="../stock_photos/' . $id . '.png" height="80px" width="40px" alt="' . $product_name . '" />
                     </td>
                     <td width="35%">
                    <span class=itmttl>' . $product_name . '</span>
                    <br />
                    <span class=text>' . $details . '
                    <br />
                    €' . $price . '</span>
                    <br />
                      <form name="bd_itm" id="bd_itm" method="post" action="help_scripts/cart_functions.php">
                    <input type="hidden" name="pid" id="pid" value="' . $id . '" />
                    <input type="submit" name="button" id="button' . $id . '" value="Add to Cart" />
                    <br />
                    <br />
                      </form>
                     </td>';
        $dynamicListBody .= ($i==1) ? '</tr>':'';
        $i++;
        ($i==2) ? $i=0:'';
        }
        $dynamicListBody .='</table>';
        } else {
            $dynamicListBody = "We have no products listed in our store yet";
            }
        mysql_close();
  • 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-25T10:34:38+00:00Added an answer on May 25, 2026 at 10:34 am

    No, you don’t have to wait until the hole table is ready, but actually wait until PHP is done loading it. Meaning, that PHP runs the hole script before it displays it.

    I think that displaying each row as separate table is extremely BAD idea. Rather, optimize your PHP so it would run faster or add flush() before the while loop end (at the end of each row..)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a view or a table valued function that returns one
This should be a simple one: I have an observableArray object called To in
Wasn't too sure exactly how to title this question, but here's the issue that
I have a case similar to this MySQL question regarding the IN clause, but
I have a dynamic list that I need to lineup nicely into 2 columns
This will hopefully be an easy one, but I'm lacking the skills! <select name=search_category
I have javascript creating and loading an iframe. The problem is that the url
I have a table with an XML type column. This column contains a dynamic
Hello im new to php but i cant make this dynamiclist to work here
how can i do a join in this query to another table dynamic list

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.