<?php
	require("__include-common.php");
	require("../account/__logincheck.php");
	$con = my_mysql_connect(_DB_SCHEMA);
	$sql = "select * from m_memo where id_account = ".$_SESSION['login_id']."";
	$rs = my_mysql_query($sql);
	if (mysql_num_rows($rs) == 0) {
		$sql = "insert into m_memo ";
		$sql .= "(id_account";
		$sql .= ", c_memo";
		$sql .= ") values (";
		$sql .= "'".$_SESSION['login_id']."'";
		$sql .= ", '".post_to_mysql("c_memo")."'";
		$sql .= ")";
		$ret = my_mysql_query($sql, "登録できませんでした。");
	} else {
		$rec = mysql_fetch_array($rs);
		$sql = "update m_memo set";
		$sql .= " c_memo = '".post_to_mysql("c_memo")."'";
		$sql .= ", c_updatetime = '". date("Y/m/d H:i:s") . "'";
		$sql .= " where id_account = ".$_SESSION['login_id']."";
		$ret = my_mysql_query($sql, "更新できませんでした。");
	}
?>
