Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $battlepokemon= array();
- $i = 1;
- while($rows = mysql_fetch_assoc($res))
- {
- $path = mysql_query(" SELECT * FROM pokemons WHERE pk_id = '".$rows['pkmn_id']."' ");
- $pokemon = array(
- 'opponent_increment' => $i,
- 'id' => $rows['pkmn_id'],
- 'battle_poke'=> mysql_result($path,0,"path"),
- 'battle_level' => $rows['level'],
- 'battle_health' => $rows['health']
- );
- $i++;
- $battlepokemon[]= $pokemon;
- }
- $i = 1;
- foreach ($battlepokemon as $key => $value)
- {
- if($value['opponent_increment'] == $opponent_increment)
- {
- $value['battle_health'] = 0;
- echo "Data replaced!";
- }
- $i++;
- }
- print_r($battlepokemon);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement