i have an SQL query line that is
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));
but i want to count that by using GROUP BY ...
can i count that by using "group by"
Started on the old forum in February 2012 · view the original in the archive · old links redirect here
i have an SQL query line that is
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));
but i want to count that by using GROUP BY ...
can i count that by using "group by"
DiL wrote: i have an SQL query line that is
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));but i want to count that by using GROUP BY ...
can i count that by using "group by"
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT user) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));
replace user with your group by.
example Group by lala
Then, DISTINCT lala
Good luck.
Visit my WEBSITE Project: http://www.aspirewap.net
hey thanks buddy... its working for me... you solved my problem...
but can i ask one more question ??
whats the meaning of DISTINCT ??
and its full name ?... i want to get some knowledge about that... thanks in advance 🙂
DiL wrote: hey thanks buddy... its working for me... you solved my problem...
but can i ask one more question ??
whats the meaning of DISTINCT ??
and its full name ?... i want to get some knowledge about that... thanks in advance :)
Only count different value from sql.
Visit my WEBSITE Project: http://www.aspirewap.net