Add: maestro log DB

This commit is contained in:
2018-10-30 12:27:55 +09:00
parent 90c8ffa3a6
commit 542afc69d9
6 changed files with 95 additions and 3 deletions
+72
View File
@@ -0,0 +1,72 @@
<?php
function insertMaestroLog($type, $maestro_id, $remark) {
global $db_conn;
// echo("\n$type");
// echo("\n$maestro_id");
// echo("\n$remark");
$query = "
INSERT INTO maestro_log (Type, MaestroID, LogDateTime, Remark)
VALUES (?, ?, NOW(), ?);
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('sis', $type, $maestro_id, $remark);
$stmt->execute();
// echo "\ninsertMaestroLog";
}
/*
function get_app_highest_record($maestro_id, $app_id, $player_id) {
global $db_conn;
$query = "
SELECT HighestRecord
FROM app_highest_record
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ?;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("iii", $maestro_id, $app_id, $player_id);
$stmt->execute();
$stmt->bind_result($app_highest_record);
$stmt->fetch();
$stmt->close();
return $app_highest_record;
// echo "\nget_app_highest_record : $app_highest_record";
}
function remove_app_highest_record($maestro_id, $app_id, $player_id) {
global $db_conn;
$query = "
DELETE FROM app_highest_record
WHERE MaestroID = ? AND AppID = ? AND PlayerID = ?;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("iii", $maestro_id, $app_id, $player_id);
$stmt->execute();
// echo "\ndelete_app_highest_record";
}
function insert_app_highest_record($maestro_id, $app_id, $player_id, $app_highest_record) {
global $db_conn;
$query = "
INSERT INTO app_highest_record (MaestroID, PlayerID, AppID, HighestRecord, RecordDateTime)
VALUES (?, ?, ?, ?, NOW());
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('iiid', $maestro_id, $player_id, $app_id, $app_highest_record);
$stmt->execute();
// echo "\ninsert_app_highest_record";
}
*/
?>