Hey everyone, I was hoping someone could lend me a hand with this, im not advanced by any means with php.
This is the script
$mapside='1';
preg_match_all( "/\<Player\>(.*?)\<\/Player\>/s",
$contents , $data );
foreach( $data[0] as $value )
{
preg_match_all( "/\<Name\>(.*?)\<\/Name\>/",
$value, $name );
preg_match_all( "/\<Score\>(.*?)\<\/Score\>/",
$value, $score );
preg_match_all( "/\<Kills\>(.*?)\<\/Kills\>/",
$value, $kills );
preg_match_all( "/\<Deaths\>(.*?)\<\/Deaths\>/",
$value, $deaths );
preg_match_all( "/\<TOP\>(.*?)\<\/TOP\>/",
$value, $top);
preg_match_all( "/\<Ping\>(.*?)\<\/Ping\>/",
$value, $ping);
preg_match_all( "/\<IP\>(.*?)\<\/IP\>/",
$value, $ip);
preg_match_all( "/\<Nr\>(.*?)\<\/Nr\>/",
$value, $nr );
preg_match_all( "/\<V\>(.*?)\<\/V\>/",
$value, $v );
preg_match_all( "/\<W\>(.*?)\<\/W\>/",
$value, $w );
preg_match_all( "/\<Dmg\>(.*?)\<\/Dmg\>/",
$value, $dmg );
preg_match_all( "/\<Kill\>(.*?)\<\/Kill\>/",
$value, $rndkill );
preg_match_all( "/\<L\>(.*?)\<\/L\>/",
$value, $l );
preg_match_all( "/\<B\>(.*?)\<\/B\>/",
$value, $b );
preg_match_all( "/\<H\>(.*?)\<\/H\>/",
$value, $h);
echo " Player=> " .$name[1][0].
" Score=> ". $score[1][0] .
" Kills=> ". $kills[1][0].
"deaths => " .$deaths[1][0].
" TOP=> " .$top[1][0].
" ping=> " .$ping[1][0].
" IP=> " .$ip[1][0].
"<br>";
$name=$name[1][0];
$score=$score[1][0];
$kills= $kills[1][0];
$deaths=$deaths[1][0];
$top=$top[1][0];
$ping=$ping[1][0];
$ip=$ip[1][0];
/*---- Part one inserts into table one no problem after i created a variable = the array----*/
/*---- I can output this no problem but its when I insert to mysql is where i dont
get data, just Array[0]... and so on or if I use the original variable name that the
script put into an array, the data is correct however it is just inserting the last
ROUND----*/
for( $i = 0; $nr[1][$i]; $i++ )
echo
" Round=> ". $nr[1][$i] .
" Vic=> ". $v[1][$i] .
" Weapon=> ". $w[1][$i] .
" dmg => ". $dmg[1][$i] .
" got kill => ". $rndkill[1][$i] .
" Leg=> ". $l[1][$i] .
" Body=> ". $b[1][$i] .
" Head => ". $h[1][$i] .
"<br><br>";
$round=$nr[1][$i];
$vic=$v[1][$i];
$weapon=$w[1][$i];
$damage=$dmg[1][$i];
$rndkill= $rndkill[1][$i];
$leg= $l[1][$i] ;
$body= $b[1][$i] ;
$head= $h[1][$i] ;
echo "<br><br>";
my insert to table one from part one
my insert to table two from part
} // close the only loop
Is there a loop I need to add for the insert statement for part two?