0

I am trying to modify a count query so I can the output onto a webpage. Current code is:

$db->setQuery("SELECT COUNT(`SubmissionId`) FROM #__forms WHERE FormId='8' ");

echo "So far we have <strong>".$db->loadResult()."</strong> submissions";

It works fine as it shows the number of submisisons where the value in the formid is 8. But I also want to include in the sum formid 4 and 5 so I have a combined total.

Any ideas?

2 Answers 2

1

Change your query for: "SELECT COUNT(SubmissionId) FROM #__forms WHERE FormId IN ('8','4','5')"

Sign up to request clarification or add additional context in comments.

1 Comment

You know what, I had been trying the IN option but for some reason I must had missed something. Now working.
0

try this query:

"SELECT COUNT(SubmissionId) FROM #__forms WHERE FormId='8' OR FormId='4' OR FormId='5'"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.