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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:39:07+00:00 2026-05-15T09:39:07+00:00

I have an online form which collects consumer data and stores in a dedicated

  • 0

I have an online form which collects consumer data and stores in a dedicated MySQL database. In some instances, data is passed in the URL under the “RefID” variable which is also stored in the database and attached to each registration.

I use the ‘mysql_num_rows ($result)’ to fetch all agent details on another page but this only returns ALL available details. My goal is as follows:

GOAL

I want to create an HTML table in which rows are automatically generated based on the list of all registrations on my site. A new row is created IF and ONLY IF a unique RefID is present on that particular record. In the event the field is NULL, it is reported on a single line.

In short, the HTML table could look something like this:

RefID – Number of Enrollments

abc123 – 10

baseball – 11

twonk – 7

NULL – 33

Where abc123 is a particular RefID and 10 is the number of times that RefID appears in the DB. If a new registration comes in with RefID = “horses”, a new row is created, showing “horses – 1”. The HTML table will be viewable by account administrators needing to see the number of enrollments for a particular RefID (which they won’t know ahead of time).

Anybody have any suggestions?

  • 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-15T09:39:07+00:00Added an answer on May 15, 2026 at 9:39 am

    I think this is what you want, I’ve test it and returns correct values:

    <?php
    
    $query = mysql_query(" SELECT DISTINCT RefID FROM test_this ");
    
    echo '<table>';
    
    while ($data = mysql_fetch_array($query)) {
    
        $uniq = mysql_num_rows(mysql_query(" SELECT * FROM test_this where RefID = '".$data['RefID']."' "));
    
        echo '<tr><td>'.$data["RefID"].'</td><td>'.$uniq.'</td></tr>';
    
    
    
    }
    
    echo '</table>';
    
    ?>
    

    If its not the solution to your problem, just let me know, I’ll try to help better!

    EDITED: The result from the above was
    a table with:

    abc123 – 5

    baseball – 4

    twonk – 6

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

Sidebar

Related Questions

I have an online form which collects member(s) information and stores it into a
I currently have an online web hosted MySQL database with HostGator.com that currently stores
I have to fill a pdf form (used to submit data online) which is
I have an online form that has a few fields with time data. I
I have an online gateway which requires an HTML form to be submitted with
I have some code which reads a file through a form field of type
I have an application which logs into an online site using POST form being
I have a code to create VIEW in mysql database which is working fine
I have an online PDF form which a user completes and then clicks a
the question's in the title really. I have an online form where, after a

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.