Jump to content

need help completing query plz


burge124

Recommended Posts

There's no way for us to know if a JOIN is needed since we have no clue as to the structure of your database. Are you querying data from multiple tales? If so, then a JOIN would be needed. But if all the data is in one table then it would look something like this:

 

SELECT count(*)
FROM question
WHERE CorrectAnswer = 'A'
  AND chapterid = 1

Link to comment
Share on other sites

hi, yes thanks thats fine... although my next query is from two tables,

 

select all from table question "CorrectAnswer" and table userattempt field "Result" are the same value

 

"SELECT * FROM question WHERE CorrectAnswer = userattempt = ???";

 

or would this require an if else statment? if correctanswer = result echo true, if correctanswer != result echo false if else echo unanswered??? thanks for your help

Link to comment
Share on other sites

Again, no way to respond without knowing your table structures. I'm not a clairvoyant. Please list the fields in the tables you need to get data from, identifying the foreign keys as applicable. Also, your explanatin of the data you are after is vague at best. Please be VERY specific.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.