Jump to content

count specific data


corbeeresearch

Recommended Posts

$count = "SELECT COUNT(ans_id) FROM plus_poll_ans WHERE opt='yes' AND opt='no'";

That doesn't make any sense -- opt can't be two different values at once.

 

Hi,

 

I'm trying to count only data with yes and no, but it kept counting everything.

 

what's wrong with my query?

 

$count = 'select count(ans_id) from plus_poll_ans where opt="yes" or opt="no"';

Shouldn't be anything -- are there any errors?

Link to comment
https://forums.phpfreaks.com/topic/215020-count-specific-data/#findComment-1119257
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.