<?php
require("calldata.php");
$sql = "SELECT * FROM ordata17";
$result = mysql_query($sql, $link);
$n=1;
while( $row = mysql_fetch_row( $result ) ){
$matrix[$n][1] = $row[0];
$matrix[$n][2] =$row[1];
$matrix[$n][3] =$row[2];
$n=$n+1;
}
for ($n=1; $n < 141; $n++) {
$no=$matrix[$n][1];
$m=$matrix[$n][2];
$mbra[$no][$m]=$matrix[$n][3];
}
$sql = "SELECT * FROM ordata18";
$result = mysql_query($sql, $link);
$n=1;
while( $row = mysql_fetch_row( $result ) ){
$matrix[$n][1] = $row[0];
$matrix[$n][2] =$row[1];
$matrix[$n][3] =$row[2];
$n=$n+1;
}
for ($n=1; $n < 141; $n++) {
$no=$matrix[$n][1];
$m=$matrix[$n][2];
$fbra[$no][$m]=$matrix[$n][3];
}
for ($age=0; $age <100; $age++) {
$no=floor($age/5)+1;
$startm[$age]=($mbra[$no][4]+$mbra[$no][5])/50;
}
for ($age=0; $age <100; $age++) {
$no=floor($age/5)+1;
$startf[$age]=($fbra[$no][4]+$fbra[$no][5])/50;
}
$sql = "truncate pdata18";
$exe= mysql_query($sql,$link);
for ($age=0; $age < 100; $age++) {
$x=$startm[$age];
$y=$startf[$age];
$sql = "insert into pdata18 values($age,$x,$y)";
$exe= mysql_query($sql,$link);
}
$close_flag = mysql_close($link);
?>
最終更新:2009年06月14日 05:13