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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:42:10+00:00 2026-06-16T20:42:10+00:00

I have a select on a database, like this: $result = mysql_query( SELECT dat_eb_registrants.id,

  • 0

I have a select on a database, like this:

$result = mysql_query("                 
SELECT dat_eb_registrants.id, dat_eb_registrants.first_name,  
    dat_eb_registrants.last_name, dat_eb_registrants.email, dat_eb_registrants.comment,   
    dat_eb_registrants.amount, dat_eb_registrants.published,   
    dat_eb_registrants.transaction_id, dat_eb_registrants.register_date,   
    dat_eb_field_values.field_value   
FROM dat_eb_registrants LEFT JOIN dat_eb_field_values 
  ON dat_eb_registrants.id=dat_eb_field_values.registrant_id
WHERE dat_eb_field_values.field_id='53' AND `event_id` >= 20 AND `event_id` <= 25
ORDER BY $sort $ascdsc
");

and it gets diplayed in a html table like so:
echo ”

ID
First name
Last name
Email
Comment
Value1
Value2
Value3
“;

while ($row = mysql_fetch_row($result)) {

echo "<tr>";
echo "<td>" . $row[0] . "</td>";
echo "<td>" . $row[1] . "</td>";
echo "<td>" . $row[2] . "</td>";
echo "<td>" . $row[3] . "</td>";
echo "<td>" . $row[4] . "</td>";

echo "<td>" . $row[9] . "</td>";

echo "<td>" . $row[?] . "</td>";
echo "<td>" . $row[?] . "</td>";
echo "</tr>";
echo "</table>";

}

Now, the first 4 values are being displayed correctly, just like the 5th one, but how about the 6th and the 7th one? they are not being called by MYSQL because dat_eb_field_values.field_value is only called one time, and is assigned the value WHERE dat_eb_field_values.field_id=’53

How can i complete the table with the other values in the database?

Thanks in advance, Laurent

  • 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-16T20:42:11+00:00Added an answer on June 16, 2026 at 8:42 pm

    If I understand correctly, you are trying to load multiple values for each person. These values are in multiple rows in a separate table.

    You’ll need to use a GROUP BY clause. JOIN the registrants table with the values table just like you do now, and after the WHERE clause, GROUP BY the registrant’s id. And of course, don’t restrict the WHERE to a certain value’s ID, because then you won’t get any other values. Finally, you can use GROUP_CONCAT() to get all the value rows into a single result value, delimited by ,. You can change this to be delimited by </td><td> to make it easier to put into your table.

    SELECT registrants.name, GROUP_CONCAT(values.value SEPARATOR '</td><td>')
    FROM registrants
    LEFT JOIN values USING (registrant_id)
    WHERE ...
    GROUP BY registrant_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: $result = mysql_query(SELECT * FROM quote ORDER BY RAND() LIMIT
I have a binary, the database table of relationships looks like this: +----+----------+---------+-----+ |
I have a database which contains an Assignment table. The table looks like this:
I have a database MySQL like this: ------------------------ | id | Name | City
I have a query that produces a result like this: The data is sorted
I have to join queries from multiple databases, something like: SELECT T1.*, T2.* FROM
I have the following SQL: SELECT * FROM [Database].dbo.[TagsPerItem] INNER JOIN [Database].dbo.[Tag] ON [Tag].Id
I have a select box that is being populated dynamically from a database. As
I have a DataTable which I select from database (Well, these data cross several
I have the below query in a postgresql database SELECT * FROM accounts where

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.