Jump to content

Limit/sort Text Query Help


paulmo

Recommended Posts

I am trying to echo the 15 most common words in column `message`, table `user`. (multiple messages from multiple users). as it is, only current user message is echoed.

$archive = mysql_query("SELECT CONCAT(message, ' ', COUNT(*)) FROM `user`GROUP BY messageORDER BY COUNT(*) DESCLIMIT 15") or die (mysql_error());$n=0;while($row = mysql_fetch_assoc($archive)){$n++;echo ($row['message']);	echo "<br>";}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...