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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:50:27+00:00 2026-05-20T18:50:27+00:00

this is a followup to my previous question , whereby I’m writing a PHP

  • 0

this is a followup to my previous question, whereby I’m writing a PHP competition script for a members site that restricts entries to one per day per member.

The entries are stored in a table “competition_entries” with the following structure:

ce_id: primary key 
ce_c_id: competition ID
ce_sub_id: member ID
ce_date: date stamp for the entry

I would like to write a MySQL query that retrieves number of entries per member, i.e.

Member A: 4 entries
Member C: 2 entries
Member Y: 23 entries
etc...

but am struggling as to how to do so. TIA.

EDIT: In case it’s not obvious, I realise I need to relate the member ID back to another table to retrieve their username – that bit I can do (sorry, long day) 🙂

  • 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-20T18:50:28+00:00Added an answer on May 20, 2026 at 6:50 pm

    I think this query should do it for you:

    SELECT COUNT(ce_sub_id) FROM competition_entries 
    WHERE ce_c_id = '$competition_id' 
    GROUP BY ce_sub_id
    

    You should have a result set with a member id and the number of entries he or she has made. You can then loop through your results, and output them in the format you described.

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

Sidebar

Related Questions

This question is a followup to a previous question , that was resolved thanks
This is a followup of a previous question I had. I got the very
This is a followup on the question: ASP.NET next/previous buttons to display single row
This is a follow-up to my previous question . Suppose I am writing the
So, this is something of a followup to my previous question. I'm running into
This is a follow up to my previous question . Consider that I write
So this is a follow-up to a previous question that I asked: Trying to
Hey guys this is a followup to my previous question . I now have
This is somewhat of a followup to my previous question , where people pointed
This is a follow up to a previous question that I had before about

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.