Ok, so here is my situation. I have 100,000+ records stored in my database. All of my users are stored in one table, and a survey they took was in another table.
What i need to do is query the user table to get their ID, then query the survey table where their ID is also stored to get a record from the survey page (who referred them). I need to do this so I can get a count of how many users each referrer sent me.
Now, the way I originaly coded it up was just to query the user table for all records between a certain date, then looped through the results and queried the survey table for each record and then just added up my totals. This worked fine until my tables grew to a large amount of records of course.
Is there a more efficient way to do this, say by using the join command or something like that?