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

  • Home
  • SEARCH
  • 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 8972049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:07:06+00:00 2026-06-15T18:07:06+00:00

I have a drupal site, and am trying to use php to grab some

  • 0

I have a drupal site, and am trying to use php to grab some data from my database. What I need to do is to display, in a user’s profile, how many times they were the first person to review a venue (exactly like Yelp’s “First” tally). I’m looking at two options, and trying to decide which is the better way to approach it.

First Option: The first time a venue is reviewed, save the value of the reviewer’s user ID into a table in the database. This table will be dedicated to storing the UID of the first user to review each venue. Then, use a simple query to display a count in the user’s profile of the number of times their UID appears in this table.

Second Option: Use a set of several more complex queries to display the count in the user’s profile, without storing any extra data in the database. This will rely on several queries which will have to do something along the lines of:

  1. Find the ID for each review the user has created
  2. Check the ID of the venue contained in each review
  3. First review for each venue based on the venue ID stored in the review
  4. Get the User ID of the author for the first review
  5. Check which, if any, of these Author UIDs match the current user’s UID

I’m assuming that this would involve creating an array of the IDs in step one, and then somehow executing each step for each item in the array. There would also be 3 or 4 different tables involved in the query.

I’m relatively new to writing SQL queries, so I’m wondering if it would be better to perform the set of potentially longer queries, or to take the small database hit and use a much much smaller count query instead. Is there any way to compare the advantages of either, or is it like comparing apples and oranges?

  • 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-15T18:07:08+00:00Added an answer on June 15, 2026 at 6:07 pm

    The volume of extra data stored will be negligible; the simplification to the processing will be significant. The data won’t change (the first person to review a venue won’t change), so there is a negligible update burden. Go with the extra data and simpler query.

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

Sidebar

Related Questions

I need to develop a site on Drupal 7. I have some content types
We have a drupal site and we wish to export data from this site
I am using some tokens in my drupal site. I have some php code
I am trying to import the SQL database from my Drupal production site into
I have Drupal 7 site which is working fine. I added a custom PHP
I have a Drupal 7 site and need to output a small calendar control
This might be a difficult one... I have a Drupal site, and I need
I have a Drupal site using jQuery 1.3, so that unfortunately I cannot use
I have recently upgraded a Drupal site to multi-webhead environment and am trying to
I am trying to make a drupal site. I have named the vocabulary as

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.