Jump to content

fritz.fx

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fritz.fx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, can't edit my post, I think I found my problem, let me get some sleep and I'll give this another hit.
  2. I'm getting nothing out of your query. (sorry, I get a bit slow without sleep) I expect different results this way. eg: george kills fred 5 times .... fred kills george 15 times. result should be george == 5 == 15 fred ==15 ==5 haven't tried out your country query yet but it looks like it's exactly what I'm looking for.
  3. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.