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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:23:41+00:00 2026-06-06T15:23:41+00:00

This is more of an approach question, I haven’t gotten to the code yet.

  • 0

This is more of an “approach” question, I haven’t gotten to the code yet. But am new to SQL and php and would like to tackle this issue intelligently.

The scenario is as follows:

I have a table called Donations, each of which has exactly one string value in the column called AREA. AREA may have any one of nine predetermined values (Northeast, Northwest, Downtown, etc…).

I also have a table of Volunteers, each of which has specified which regions they are willing to travel to, to help pick-up the donations. For each volunteer, I have 9 columns, each with a 1 or 0, corresponding to the nine areas listed above (NW, NE, DT, etc…)

I would like to run a query, series of queries or php/sql combination where by I can search for all active donations, attain which AREA’s they are in, then query the Volunteers table, and get back a list of email address for only those Volunteers willing to travel to one or more of those areas.

Any help is appreciated. (As an aside, there is no key value shared between these two tables.)

  • 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-06T15:23:42+00:00Added an answer on June 6, 2026 at 3:23 pm

    So, I solved this via a totally different method altogether, though I am sure the above methods would have worked.

    I created assigned each area a prime number, beginning with 2, 3, 5, etc…Then when a Volunteer registered, it creates a code for them by multiplying those areas they are willing to go to.

    I used the same primes for donations and assigned each donation the appropriate prime.

    Then I ran this join query, seeing if the Volunteer’s code was evenly divisble by any of the available donations.

    $q = “Select Distinct(EMAIL) from PUPS where EXISTS (Select * from Donations where STATUS = ‘ACTIVE’ AND (REGIONCODE Mod AREAPRIME = 0))”;

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

Sidebar

Related Questions

Ok this is more of general technology/approach question. We have a very simple web
This is more an algorithm question than programming, but it's implemented in programming so
To make this more clear, I'm going to put code samples: $file = fopen('filename.ext',
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Ok, I'm going to try to make this more clear because my last question
I have a label on my asp.net page, it looks like this: more info
This is more of a design question. I have a template class, and I
This is more of a theoretical question. Should logging reside within a class who's
my question is, wether or not this is possible, and if so, how would
This is more of a high-level question than anything else. I have a MVC

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.