Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Yep, use this...

Code
SELECT t2.P_Name,t2.P_Title,t3.U_Number,t3.U_Username,t2.P_Option <br />FROM   w3t_PollData AS t1, <br />       w3t_Polls AS t2, <br />       w3t_Users AS t3 <br />WHERE  t2.P_Title = 'Poll Title Goes Here' <br />AND    t1.P_Number = t2.P_Number <br />AND    t1.P_Name = t2.P_Name <br />AND    t1.P_IP = t3.U_Username <br />UNION <br />SELECT t2.P_Name,t2.P_Title,t3.U_Number,t3.U_Username,t2.P_Option <br />FROM   w3t_PollData AS t1, <br />       w3t_Polls AS t2, <br />       w3t_Users AS t3 <br />WHERE  t2.P_Title = 'Poll Title Goes Here' <br />AND    t1.P_Number = t2.P_Number <br />AND    t1.P_Name = t2.P_Name <br />AND    t1.P_IP = t3.U_Number <br />ORDER BY t2.P_Option ASC   


There are 2 instances where you'll have to include your poll title as can be seen above

--------------------

NOTE: The w3t_PollData table is a li'l funky in that it allows both usernames *and* usernumbers to be inserted into the P_IP field, which puzzles me. I'm not sure what the criteria is for one being chosen over the other.

I'll assume that there's gotta be a good reason for doing that, but I have no idea what it is at this point. If anyone knows I'd be interested in hearing.

Sponsored Links
Entire Thread
Subject Posted By Posted
Pulling Data from Polls with MYSQL query ... JasonStixBuckley 08/28/2004 3:45 PM
Re: Pulling Data from Polls with MYSQL query ... Twisty 08/28/2004 8:50 PM
Re: Pulling Data from Polls with MYSQL query ... JasonStixBuckley 08/28/2004 9:26 PM
Re: Pulling Data from Polls with MYSQL query ... JasonStixBuckley 08/28/2004 11:24 PM
Re: Pulling Data from Polls with MYSQL query ... Twisty 08/29/2004 5:05 AM
Re: Pulling Data from Polls with MYSQL query ... JasonStixBuckley 08/29/2004 5:31 AM
Re: Pulling Data from Polls with MYSQL query ... Twisty 08/29/2004 5:57 AM
Re: Pulling Data from Polls with MYSQL query ... Twisty 08/29/2004 11:30 AM
Re: Pulling Data from Polls with MYSQL query ... JasonStixBuckley 08/29/2004 8:32 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)