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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:39:00+00:00 2026-05-25T23:39:00+00:00

I using 3 tables to store booking information: eventinfo, customer and testbook. My Coding:

  • 0

I using 3 tables to store booking information: eventinfo, customer and testbook.

My Coding:

<?php

 include('config.php');
 $per_page = 9; 
 if($_GET)
 {
 $page=$_GET['page'];
 }

 //get table contents
 $start = ($page-1)*$per_page;
 $sql = "SELECT bookingID,eventinfo.eventTitle,boothAlias,testbook.bstatus,date'"
."testbook.username, customer.companyName, customer.contactName"
."from eventinfo, testbook, customer where testbook.username=customer.username"
." and testbook.eventID=eventinfo.eventID order by date limit $start,$per_page";
$rsd = mysql_query($sql);
?>


<table width="800px">

    <?php
    //Print the contents

    while($row = mysql_fetch_array($rsd))
    {

        $id=$row['companyName'];
        $contactName=$row['contactName'];
        $eventTitle=$row['eventTitle'];
        //$phone=$row['phone'];
        $date=$row['date'];
        $status=$row['bstatus'];
        $booth=$row['boothAlias']

    ?>

   <tr><td style="color:#B2b2b2; padding-left:4px"><?php echo $id; ?></td><td><?php echo $contactName; ?></td>
    <td><?php echo $eventTitle; ?></td><td><?php echo $booth; ?></td><td><?php echo $date; ?></td><td><select name='status' id='status'>
        <option value='-1'>--Select--</option>
    <option value='0'>Approve</option>
    <option value='1'>Reject</option>
    <option value='2'>Pending</option>
    </select></td>
    </tr>
    <?php
    } //while
    ?>
</table>

And it return this:

picture1

I try to print out the record in the following pattern:

picture2

Anyone can help me?

  • 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-25T23:39:00+00:00Added an answer on May 25, 2026 at 11:39 pm

    Assuming you have all of your records ordered by id first, followed by contactName and then eventTitle, a simple conditional can check to see if the current records values match that of the previously displayed record, and if they do, omit them. I’ve use ternary operators in this code just for the sake of compactness.

    <?php
    
    while($row = mysql_fetch_array($rsd)) {
    
        $date=$row['date'];
        $status=$row['bstatus'];
    
    ?>
    
    <tr><td style="color:#B2b2b2; padding-left:4px"><?php echo ($id == $row['id']) ? "" : $row['id']; ?></td><td><?php echo ($contactName == $row['contactName']) ? "" : $row['contactName']; ?></td>
    <td><?php echo ($eventTitle== $row['eventTitle']) ? "" : $row['eventTitle']; ?></td><td><?php echo ($booth== $row['boothAlias']) ? "" : $row['boothAlias']; ?></td><td><?php echo $date; ?></td><td><select name='status' id='status'>
        <option value='-1'>--Select--</option>
    <option value='0'>Approve</option>
    <option value='1'>Reject</option>
    <option value='2'>Pending</option>
    </select></td>
    </tr>
    <?php
    
        $id=$row['companyName'];
        $contactName=$row['contactName'];
        $eventTitle=$row['eventTitle'];
        //$phone=$row['phone'];
        $booth=$row['boothAlias'];
    
    } //while
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
i store (non equidistant) time series as tables in hdf5 files using the H5TB
I'm using MySQL to store video game data. I have tables for titles, platforms,
I have the following tables within a database, that I am using to store
I have a huge database with 100's of tables and stored procedures. Using SQL
I'm using a hash table (source code by Google Inc) to store some method
Using the stored procedure sp_msforeachtable it's possible to execute a script for all tables
I am using an sqlite database to store log data. My table has a
I'm currently using MSSQL Server 2000 and to design tables, create and alter stored
Should I still be using tables anyway? The table code I'd be replacing is:

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.