Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End User voting system problem Reply To: User voting system problem

#165583
Josh Johnson
Participant

@jurotek, @traq
Okay so here is my DB schema to make things a bit more clearer. When a user signs up, the correct user type is set. If that user type is freelancer, their job title and price per hour is inserted into the freelancers table.

What I ideally need is an SQL statement that will grab the first name, last name, location, experience from the users table, job title and price per hour from the freelancers table only if the user has < 10 votes (including users with 0 votes and therefore no entries in the user_votes table.

users
user_id (PK)
firstname
lastname
email
email_code
time_joined
location
password
experience
bio
confirmed
generated_string
ip
user_type

freelancers
freelancer_id (PK)
user_id (FK)
jobtitle
priceperhour

user_votes
vote_id (PK)
user_id (FK)
voted_by_id (FK)
votes