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

  • This topic is empty.
Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #166452
    Josh Johnson
    Participant

    @traq Ah! School boy error. It’s working now.

    Not sure what you mean about grouping the votes?

    SELECT 
        user_types.user_type,
        users.user_id,
        users.firstname, 
        users.lastname, 
        users.location, 
        user_experience.experience,
        users.portfolio,
        Count(user_votes.vote_id) 
        AS CountOfvote_id, 
        freelancers.jobtitle, 
        freelancers.priceperhour
        FROM users 
        AS voters
        RIGHT JOIN 
        ((((users LEFT JOIN user_votes 
        ON users.user_id = user_votes.vote_id) 
        LEFT JOIN freelancers 
        ON users.user_id = freelancers.freelancer_id) 
        LEFT JOIN user_experience
        ON users.user_id = user_experience.experience_id) 
        LEFT JOIN user_types
        ON users.user_id = user_types.user_type_id) 
        ON voters.user_id = user_votes.vote_id
        WHERE user_types.user_type != "Employer"
        GROUP BY
        users.user_id,
        users.firstname, 
        users.lastname, 
        users.location,
        user_experience.experience,
        users.portfolio,
        user_votes.vote_id,
        freelancers.jobtitle, 
        freelancers.priceperhour
        HAVING CountOfvote_id < 10
    
    #166453
    __
    Participant

    Not sure what you mean about grouping the votes?

    GROUP BY CountOfvote_id
    --  . . .
    

    Though I suppose all the other grouping you’re doing would make this unnecessary. Are you getting the correct (expected) results now?

    #166458
    Josh Johnson
    Participant

    @traq, @jurotek Yes I am – Thanks a lot for your help, I really appreciate it

Viewing 3 posts - 16 through 18 (of 18 total)
  • The forum ‘Back End’ is closed to new topics and replies.