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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:50:32+00:00 2026-06-06T11:50:32+00:00

I have this table And my goals is to have a table looking like

  • 0

I have this table enter image description here

And my goals is to have a table looking like this

enter image description here

The table has 8 rows and 3 columns

I have already stored the questions but I’m having a hard time printing it in this format.

Wherein after printing 4 questions it will then go to another cell and print 4 questions again and then once there are already 3 columns it will then create a new row and do the same step again.( 8 rows and 3 columns)

The questions are ordered by sequence no. [In the table below the 1st 4 questions are 1,2,3,4 and then the cell on it’s right are 6,7,8,9 and so on….]

I’m stuck with this for almost 8 hours already….

Here’s my current code:

select = "SELECT q.QuestionID, q.QuestionText, q.m, q.l, q.GroupNo, q.SequenceNo FROM question2 q Order By q.SequenceNo";
$result = mysql_query($select);
$question_id = "";
$question_text = "";
$question_m = "";
$question_l = "";
$question_group = "";
//$table = "<table border='1' cellspacing='1'>";
$count_row = 0;
$array = array();
//$count_column = 0;
while($row = mysql_fetch_array($result))
{
    $question_id = $row['QuestionID'];
    $question_text = $row['QuestionText'];
    $question_m = $row['m'];
    $question_l = $row['l'];
    $question_group = $row['GroupNo'];
    $question_sequence = $row['SequenceNo'];

    if($count_row > 2)
    {
        $array[] .= "</div>";   
    }

    $array[] .= "<div style='border=1px';'>";
    $array[] .= $question_text ."<br/>";
    $count_row++;
}

$table .= "</table>";
echo $table;

Sir/Ma’am your answers would be of great help. Thank you++

  • 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-06-06T11:50:34+00:00Added an answer on June 6, 2026 at 11:50 am

    I am not sure I fully understand the question but you could try this. I believe it will give you the output you want.

    $row_count = 0;
    echo "<table border=1>";
    
    while($row = mysql_fetch_array($result)) {
    
        if($row_count%12 == 0) {
        echo "<tr>";
        }
    
        if($row_count%4 == 0) {
        echo "<td>";
        }
    
        echo $row['QuestionText']."<br>";
    
        if($row_count%4 == 3) {
        echo "</td>";
        }
        if($row_count%12 == 11) {
        echo "</tr>";
        }
        $row_count++;
    
    }
    echo "</table>";
    

    It should give you an output that looks like this:

    <table border=1>
    <tr>
    <td>0<br>1<br>2<br>3<br></td>
    <td>4<br>5<br>6<br>7<br></td>
    <td>8<br>9<br>10<br>11<br></td>
    </tr>
    <tr>
    <td>12<br>13<br>14<br>15<br></td>
    <td>16<br>17<br>18<br>19<br></td>
    <td>20<br>21<br>22<br>23<br></td>
    </tr>
    <tr>
    <td>24<br>25<br>26<br>27<br></td>
    <td>28<br>29<br>30<br>31<br></td>
    <td>32<br>33<br>34<br>35<br></td>
    </tr>
    ...
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this table: id feed_id ... Let's say that I have 500 rows
I have this table structure and would like to map it using Fluent Hibernate
I have two tables looking like this: A B id_attr value id id_attr value
I have table consisting of notes for every user which looks like this: user_id
I have this table CREATE TABLE [dbo].[friend_blocked_list]( [subdomain] [varchar](50) NOT NULL, [un] [nvarchar](50) NOT
I have this table CREATE TABLE `codes` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
i have this table in UTF8 (collation is utf8_bin in case it matters). I
I have this table: CREATE TABLE `test` ( `ID` int(11) NOT NULL auto_increment, `text`
I have this table: fourn_category (id , sub) I am using this code to
I have this table: CREATE TABLE `point` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `siteid`

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.