[SQL HELP] please read this one....

Started on the old forum in February 2012 · view the original in the archive · old links redirect here

3 replies · 364 views · started 14 years ago · 1 min read

2 participants
m4ster_v4 Developer · 125 posts #2

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

m4ster_v4 Developer · 125 posts #4

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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close