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

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.