EasyCFM.COM ColdFusion Forums / Coding Help! / sql question

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: sql question

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Caliber
03-02-2005 @ 12:44 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 106
Joined: Sep 2003

I'm trying to set up a polling system on my site. The polling works fine, but I'm trying to link it to 3 sections of my site.

1st
if a user emails me, in my reply I want to drop the poll in the reply email back to the user

2nd
if a user goes to the FAQ section of the site. I want them to be able to survey the answer given.

3rd
I also want to survey the tutorial section.

my question is how would I link the tables together to tell what poll anwser is coming from the different sections? I hope this makes sense....I would hate to get chewed out by CJ again for asking a SILLY question LOL!

no question is silly or stupid....its only silly and stupid when you don't ask!!!

CJ
03-02-2005 @ 1:10 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

i'd say a hidden form field to state the location of the poll.

ie
<input type="hidden" name="poll_location" value="email" />

as far as stupid questions...no, there are no stupid questions (well, let's just assume that for the sake of argument).  i don't think i've ever (visibly) gotten upset with anybody for asking a specific question.

my issue comes when somebody asks a question like:

I have the following code:
[INSERT 10000 LINES OF CODE HERE]
...why doesn't it work?


Pablo and I put the forum guidelines together for a reason.  those guidelines clearly state how to ask a question "the right way".

asking "the right way" enables us to help you better.  nobody is going to pore through 10000 lines of code to figure out why it doesn't work (especially if "doesn't work" isn't clearly defined in the question).  nobody has the time for that...and it's frustrating, because we're here to help...but it makes it that much more difficult for us to do that.

all we ask is that you do the following:

1) state what it is you are trying to achieve (i.e. "i'm trying to upload a file to the server")
2) state the issue (i.e. "the file doesn't get uploaded").  be specific.  if there's an error, paste the error message.  if there's no error, state that there's no error...then explain what is happening that's not supposed to be (or what's not happening that's supposed to be)
3) post -relevant- code.  too many people say, "i have a problem..." then go on to accurately explain the problem...and post 3 pages worth of code.  again, it goes back to the time that we have to invest in helping you.  i'm much more likely to look at a relevant snippet of code than i am to pore through 3 pages of code trying to isolate the relevant code.

if i "chewed you out" before, I apologize (i know you were kinda kidding...but just in case you weren't).  it's not my intention to do anything other than help.  sometimes it just gets frustrating when part of that help entails having to post numerous messages trying to extract the information that should have been included in the original post.

</cf_rant> Smile  


-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Caliber
03-02-2005 @ 1:20 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 106
Joined: Sep 2003

Here are my tables in detail:

FAQ
==============================
FAQID
Question
Answer
DateCreated
DateUpdated

TUTORIALS
==============================
TutorialsID
Problem
Solution
DateCreated
DateUpdated

EMAILMESSAGE
==============================
MessageID
Tier
Email
Message
DateCreated
DateUpdated

PollAnswers
==============================
AnswerID
QuestionID
Answer
Votes

How can I link the tables together to know which Poll Answer came from which section?



no question is silly or stupid....its only silly and stupid when you don't ask!!!

Caliber
03-02-2005 @ 1:25 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 106
Joined: Sep 2003

Thanx CJ for replying so quickly. I use the line that you  wrote and it work fine, but what if I wanted to pull out a single FAQ record and view the total votes for that one record? I know I have to use a foreign key, but how when I get all three sections in there?

no question is silly or stupid....its only silly and stupid when you don't ask!!!

Caliber
03-02-2005 @ 1:28 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 106
Joined: Sep 2003

oh yeah...I was kidding. LOL...you and everybody on the easycfm team are awesome and beginner like me would be lost without you guys...so thanx again and in advanced.

no question is silly or stupid....its only silly and stupid when you don't ask!!!

GrowlyBear
03-02-2005 @ 1:50 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1314
Joined: May 2004

1)How do they "answer" the poll in the email you sent?

2)The PollAnswers needs more fields if (i am guessing) it will hold all the info from polls in either FAQ, Tutorial or email. More fields that will hold the hidden form field info CJ suggested.


Evil Grin  CJ how does Caliber taste? Seeing as you have chewed on him.

~~~~~~~~~~~~~~~~~~~
There is no place like 127.0.0.1

Caliber
03-02-2005 @ 3:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 106
Joined: Sep 2003

I put foreign keys for FAQ, TUTORIALS and EMAILMESSAGES in the POLLANSWERS table and get it to work....I just though there was an easier way.

no question is silly or stupid....its only silly and stupid when you don't ask!!!

CJ
03-02-2005 @ 3:56 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

no...that sounds about right Smile  

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Sponsored By...
iOpenSoft, LLC is a Houston, Texas Advanced Technology Studio Specializing in Web Design, Web Development, iPhone App Development and Android App Development.