$scanbody3 = $_COOKIE["scanbody3"]; //userid(ユーザー識別用)
//本日の日付を取得する
//日本時間の取り出し
putenv("TZ=JST-9");
$timestampJ = mktime();
$JST_y=strftime( "%Y",$timestampJ);
$JST_m=strftime( "%m",$timestampJ);
$JST_d=strftime( "%d",$timestampJ);
$JST_H=strftime( "%H",$timestampJ);
$JST_M=strftime( "%M",$timestampJ);
$JST_s=strftime( "%S",$timestampJ);
$tourokubi = $JST_y."-".$JST_m."-".$JST_d." ".$JST_H.":".$JST_M.":".$JST_s;
//DBのオープン開始
$dbHandle=mysql_connect ("localhost", "nstar10_7starweb", "2549TA") ;
//DBの選択//DBの接続に失敗した場合はエラー表示をおこない処理中断
if ($dbHandle == False) {
print ("can not connect db\n");
exit;
}
//DB名
$db = "nstar10_diet";
//ダイエットデータの読み出し
$sql = "select metabo from bodydata where id=(select max(id) from bodydata where kubun1='1' and userid='$scanbody3')";
$rs = mysql_db_query($db,$sql);
if( !$rs ) {
print "クエリが発行できません
\n";
print "SQL: $sql
\n";
print "Error: " . mysql_error() . "
\n";
exit;
}
$row = mysql_fetch_array($rs);
$metabo = $row['metabo']; //基礎代謝量
//DBへの接続を切断
mysql_close($dbHandle);
?>
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|