ell i tried, and i came to the next step, i got this script working now
$query = "SELECT persid, count(logid) from reactie GROUP BY persid order by
persid";
$result = mysql_query($query);
$query_data = mysql_fetch_array($result);
$total_num_user = $query_data[0];
while($query_data = mysql_fetch_array($result)){
$tlogid = $query_data["count(logid)"];
$persid = $query_data["persid"];
echo "$persid =";
echo "$tlogid<br>";
}
shown as:
persid - count(logid)
16 =1
18 =2
19 =1
20 =2
21 =5
now how can i write the scrip that i can select the maximum value of
count(logid) ??
Irlan
$result = mysql_query($query);
$query_data = mysql_fetch_array($result);// Haal de gegevens uit
de
tabel
NOW I WANT TO ECHO I"T:
echo "$query_data[8]";
Every call to mysql_fetch_array() will return a row from your query
result. The normal way to get all the data is to loop like this:
while($row = mysql_fetch_array($result)) {
// Do something with $row
}
--
Cheers
- Jacob Atzen