Jump to content
php.lv forumi

Sortešana pēc COUNT rezultātiem


neo

Recommended Posts

MYSQL tabulas "rez" lauks:

 

a

-----------

1

1

1

4

4

7

8

8

 

$query = "SELECT *, COUNT(a) FROM rez GROUP BY a ";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
  	echo "$skaits Cipars <b>".$row[a]."</b> a laukaa ir ievadiits ". $row['COUNT(a)'] ." reizes.";
echo "<br />";
}

 

Nekaadiigi nesanaak sasorteet peec reizu skaita cik dotajaa laukaa atkaartojas katrs cipars. HELP!

 

Paldies jau iepriekš.

Edited by neo
Link to comment
Share on other sites

×
×
  • Create New...