Jump to content

Solarian_TK

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Solarian_TK's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey Folks! So, my brain is hurting now... I am making a little process to go through a table and if a row as one set of data, and the next row as the same data based on 3 fields then update a field in the current row. Here is a snippet of what I have been working on: <?php date_default_timezone_set('AUSTRALIA/BRISBANE'); $lasthour = (time() - 3600); $lastattack45 = (time() - 2820); $lasthalfhour = (time() - 1800); $lastfifteen = (time() - 900); $lastfhourhalf = (time() - 5400); $next15 = (time() + 900); $now = time(); mysql_connect($mysql_host, $mysql_user, $mysql_password) or die('Error connecting to mysql'); mysql_select_db($mysql_database); $result = mysql_query("SELECT feeder, attacker, defender, attacklandunix, smurfid, smurf, unixtime, record, leader FROM nation_incoming WHERE attacklandunix > $now && smurf <> 'smurfed' ") or die("SELECT Error: ".mysql_error()); while($row = mysql_fetch_array($result)){ $a[][feeder] = $row['feeder']; $a[][defender]= $row['defender']; $a[][landing]= $row['attacklandunix']; } foreach($a as $b){ //in here it is to compare the 'feeder' && 'defender' && 'attacklandunix' to the next row. IF the same combo exists, then update field 'leader' to "0". else update 'leader' to "1" } ?> How can/should I pull up the next row?
×
×
  • 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.