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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:07:31+00:00 2026-05-26T13:07:31+00:00

I am working on a booth booking system. Customer can choose booth and the

  • 0

I am working on a booth booking system. Customer can choose booth and the day to book.

enter image description here

Each selected check box will store in a booking ID after press button Reserve (etc: 3 checked box = 3 booking ID).

When I display all the booking, it will display all the booth and the day. If I book a same booth for 3 days, it will display separately in 3 rows.
enter image description here

How I want to modify my coding so that I can display same booth and its corresponding days in a single row as show below:
enter image description here

Here is my coding:

<?php 

     include("dbconfig.php");

     $query4 = "SELECT bookingID,eventinfo.eventTitle,boothAlias,testbook.bstatus,date,day, username FROM eventinfo, testbook WHERE username='$user' AND testbook.eventID = eventinfo.eventID order by date desc";
     //$query4="select * from testbook, eventinfo where username= '$user' and testbook.'$event'==eventinfo.'$event' order by eventID asc";

        $result4 = mysql_query($query4);
        while($row=mysql_fetch_array($result4))
        {
        $booth=stripslashes($row["boothAlias"]);
        $day=stripslashes($row["day"]);
        $event= stripslashes($row["eventTitle"]);
        $date=stripslashes($row["date"]);
        $bstatus=stripslashes($row["bstatus"]);

    if ($bstatus==0){

        echo "<tr class='record'>";
        echo "<td class='reg' width='80'>$booth</td>";
        echo "<td class='reg' width='80'>$day</td>";
        echo "<td class='reg' width='180'>$event</td>";
        echo "<td class='reg' width='150'>$date</td>";
        echo "<td class='reg' width='70'><img src='icon_stop.gif'/></td>";
        echo "<td class='reg' width='30'><a id='$row[bookingID]' style='color:#ff0000;' class='delbutton' href='#'><img src='icon_delete.gif' border='0'></a></td></tr>";
    }else{
        echo "<tr class='record'>";
        echo "<td class='reg' width='80'>$booth</td>";
        echo "<td class='reg' width='80'>$day</td>";
        echo "<td class='reg' width='180'>$event</td>";
        echo "<td class='reg' width='150'>$date</td>";
        echo "<td class='reg' width='70'><img src='icon.approve.gif'/></td>";
        echo "<td class='reg' width='30'><a id='$row[bookingID]' style='color:#ff0000;' class='delbutton' href='#'><img src='icon_delete.gif' border='0'></a></td></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-26T13:07:31+00:00Added an answer on May 26, 2026 at 1:07 pm

    Your query needs a GROUP BY clause, along with the GROUP_CONCAT() aggregate function:

    SELECT 
        bookingID,
        eventinfo.eventTitle,
        boothAlias,
        testbook.bstatus,
        date,
        GROUP_CONCAT(day SEPARATOR ', ') AS day, 
        username 
    FROM eventinfo, testbook 
    WHERE username='$user' 
        AND testbook.eventID = eventinfo.eventID 
    GROUP BY booths, date
    ORDER BY date desc
    

    This is untested, but should do what you want. If you get an incorrect result, change what fields you use in your GROUP BY clause.

    In your query, you’re using an implicit join, which isn’t as good as using an explicit join. Without knowing your table structure, I can’t edit the query into an explicit join, but you should look this up and convert it yourself. It’ll save you many a headache with larger queries.

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

Sidebar

Related Questions

I am working on an iPhone application for a customer. After the development will
can get both working individually, but am unable to get them working together. this
I'm working on a small project. There will be a Main Abstract class for
I'm working on a employee booking application. I've got two different entities Projects and
Problem: How can I get liveliness notifications of booth publisher connect and disconnect? Background:
My colleague and me are both working in a MVC system on the same
I am creating an online booking system & need to exclude closed days from
I am creating an online booking system & need to exclude closed days from
How can make my iphone application is working both single tasking and multitasking. Like
I have one more problem. I am working on migrating one big system (what

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.