News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Viewing Who voted in polls

Started by mattchewone, June 29, 2009, 04:13:51 PM

Previous topic - Next topic

dkpeppard

Quote from: Arantor on September 03, 2013, 12:56:30 PM
Then apparently it isn't still valid :P

The column names were changed in 2.0.

Try this:
SELECT smf_members.real_name, smf_poll_choices.label
FROM smf_log_polls
INNER JOIN smf_members ON smf_log_polls.id_member = smf_members.id_member
INNER JOIN smf_poll_choices ON smf_log_polls.id_choice = smf_poll_choices.id_choice
AND smf_log_polls.id_poll = smf_poll_choices.id_poll
WHERE smf_log_polls.id_poll = 42


Thanks for the quick reply! :)

Your code worked without any error, but I also didn't get any username results.

When I ran the code you supplied, I was returned this:

'MySQL returned an empty result set (i.e. zero rows). (Query took 0.0004 sec)'

At least two active users have voted in the poll, but I see no usernames returned. What should I try next, please?

Arantor

Then you could always try installing the Voter Visibility mod...
Perhaps it would have been better if I'd simply never bothered. Y'all clearly would be less unhappy that way.

dkpeppard

Quote from: Arantor on September 03, 2013, 01:17:48 PM
Then you could always try installing the Voter Visibility mod...

Yeah, I was hoping to use something like this code query. It would not require me to install any modules on my forums, and I only use polls every so often.

Thank you again for your assistance.

dkpeppard

Quote from: Arantor on September 03, 2013, 01:17:48 PM
Then you could always try installing the Voter Visibility mod...

A little more background why I was hoping the MySQL script would work:

The other reason I don't just install the Voter Visibility mod is because I am one of those users who have issues with the automatic install of mods on my forums. I always have to do manual installs of forum updates, I can never use the automatic package install. The automatic process always fails.

I have my forums on a hosted site. Perhaps if I hosted my forums locally, I wouldn't have any issue, but since I have to work with my hosting provider, I have never been able to get any of the automated processes to work correctly.

I started trying to do the Voter Visibility mod install, but there is so much to edit manually, I was concerned I would either break something on my current forums, or I would break something on my forums when the next version update, such as 2.0.6, came out.

Bushstar

The information on getting the poll number does not seem correct in this thread. The poll number is not the topic number.

To get the poll number view the source of the page and look for poll=

The number after poll= is your poll number.

ajberry

If you select the data from smf_polls


SELECT *
FROM smf_polls


You will see the id's of all of your polls to then feed into the above mentioned query

Advertisement: