Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. $battlepokemon= array();
  2.  
  3. $i = 1;
  4. while($rows = mysql_fetch_assoc($res))
  5. {
  6. $path = mysql_query(" SELECT * FROM pokemons WHERE pk_id = '".$rows['pkmn_id']."' ");
  7. $pokemon = array(
  8. 'opponent_increment' => $i,
  9. 'id' => $rows['pkmn_id'],
  10. 'battle_poke'=> mysql_result($path,0,"path"),
  11. 'battle_level' => $rows['level'],
  12. 'battle_health' => $rows['health']
  13. );
  14. $i++;
  15. $battlepokemon[]= $pokemon;
  16. }
  17.  
  18. $i = 1;
  19. foreach ($battlepokemon as $key => $value)
  20. {
  21. if($value['opponent_increment'] == $opponent_increment)
  22. {
  23. $value['battle_health'] = 0;
  24. echo "Data replaced!";
  25. }
  26. $i++;
  27. }
  28. print_r($battlepokemon);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement