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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:41:15+00:00 2026-06-15T01:41:15+00:00

I have two tables. First table is je_addchoice , which contains fields like choiceid

  • 0

I have two tables. First table is je_addchoice, which contains fields like

  • choiceid
  • pollid
  • choicename
  • choicecreatorid

and the second table is je_uservote and the fields are

  • userid
  • pollid
  • choiceid

What i want to do is,

Display the choice names based on the no of votes in the je_uservote table

$query = select * from je_addchoice where poll_id='$poll_id' //order by (count(choiceid)) from second table

//QUERY FOR DISPLAY CHOICENAMES BASED ON COUNT OF VOTES

How to write the above query

My question is how to access the no of counts in the jeuservote table and display the choicenames based on the result count. Actually the votes for the choicenames in the addchoice table count is stored in the jeuservote table. How can i access the vote count for the choice names

  • 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-15T01:41:16+00:00Added an answer on June 15, 2026 at 1:41 am
    SELECT *, (
                SELECT count(*) 
                FROM je_uservote T2 
                WHERE T2.pollid=T1.pollID 
                AND T2.choiceid=T1.choiceID) AS votes
    FROM je_addchoice T1
    ORDER BY votes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have xpath page.search(//table[@class='campaign']//table) which returns two tables. I need to choose only first
I have two tables with FIRST and SECOND id. <TABLE ID=FIRST> <TR> <TD></TD> <TD></TD>
I have two tables, both with the same columns. The first table contains original
I have two tables which I need to join. First Table: EFF_DATE RATE CURRENCY
I have two tables, the first table has the product and the second table
I have two tables. First table have columns: price, code_one Second table has: code_one,
I have two tables. First table looks like this: Table: Records rid | user
I have two tables set up. The first table contains a listing of apartments,
I have two tables. The first table is Requests and it looks like this
I have two tables like the following hotels ------ hotelID hotelName Second table operators

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.