Hey guys.
I haven't done any PHP for a while and my memory isn't so good
I'm trying to do a count from 2 columns in one table from an array of names.
Table setup:
this is what I have:
$names = array('Losos', '.minion', 'STAVY', 'brothrsinarms', '.-(AUST)-.Fatal', 'Vergetta');
foreach ($names as $names) {
$result = mysql_query("SELECT *, count(killer) as kills, count(victim) as deaths FROM tbl_killlog where killer = '$names'");
while($row = mysql_fetch_array($result))
{
$name = $row['killer'];
$kills = $row['kills'];
$deaths = $row['deaths'];
echo "$name == $kills == $deaths<br>";
}
}
So, what I want, is for each $name get the number of "kills" (killer) AND the number of "deaths" (victim) but for some reason I'm getting the same result from both.
Anybody got any ideas??
Oh, also, just one more query, Another table I have is a log of names/countries. what would the query be for counting individual country names.. eg " ireland = 5, Germany = 15 etc etc ??
table pic:
Cheers
Fritz