Jump to content

Displaying Results from multiple fields


Suchy

Recommended Posts

I want to pull something like this off:

word   excel   powerpoint
10        2          5

 

But I am getting results such as:

word   
10        
2          
5

 

Here is my query:

SELECT COUNT(*) AS "word" FROM `signin` WHERE `event` LIKE "%word%" 
UNION SELECT COUNT(*) AS "excel" FROM `signin` WHERE `event` LIKE "%excel%" 
UNION SELECT COUNT(*) AS "powerpoint" FROM `signin` WHERE `event` LIKE "%powerpoint%" 

 

How can I fix up the query?

 

Link to comment
https://forums.phpfreaks.com/topic/162827-displaying-results-from-multiple-fields/
Share on other sites

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.