CodingSQL (ugh!)

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  Mikee      
30338.4 In reply to 30338.1 
Not sure if this will work, but hopefully its along the right lines:
SQL code:
SELECT id, SUM(questiontext IN (...)) AS match_count
FROM mytable
WHERE surveyid = 1
GROUP BY id

Basically, you just get all rows with a matching surveyid and count the number of matching questions.

Then you just use the query's recordcount to supply you with the first count. (which in PHP I think you use the sizeof() function for)

But like I said, I'm not sure that SQL is the precise right way of doing it.
0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  Peter (BOUGHTONP)     
30338.5 In reply to 30338.4 
if that doesn't work, an if will make it work.
0/0
 Reply   Quote More 

Reply to All    
 

1–5

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats