728x90
FTP Server
DB MySQL Server
insert example |
insert sensor_heartrate ( user, wmac, heart, train, status, ctime ) values ( 1, '00:00:00:00:00:33', 100, 3, "running", now()); |
<?php
$conn = mysqli_connect('localhost', 'cherrychance', 'Winning22!', 'cherrychance');
switch($_GET['mode']){
case 'insert':
$sql = "INSERT INTO sensor_heartrate ( user, wmac, heart, train, status, sec, ctime ) VALUES (".($_POST['user']).", '".($_POST['wmac'])."', ".($_POST['heart']).", ".($_POST['train']).", '".($_POST['status'])."', ".($_POST['sec']).", now());";
echo $sql;
$result = mysqli_query($conn, $sql);
echo "<br>result= ".$result;
//header("Location: list.php");
break;
case 'delete':
mysqli_query('DELETE FROM topic WHERE id = '.mysqli_real_escape_string($_POST['id']));
header("Location: list.php");
break;
case 'modify':
mysqli_query('UPDATE topic SET title = "'.mysqli_real_escape_string($_POST['title']).'", description = "'.mysqli_real_escape_string($_POST['description']).'" WHERE id = '.mysqli_real_escape_string($_POST['id']));
header("Location: list.php?id={$_POST['id']}");
break;
}
?>
Mysql 접속
C:\Users\yc253>mysql -u cherrychance -p --host 210.114.6.202 |
참고사이트
'M64 > Database' 카테고리의 다른 글
How to make Mysql Ubuntu Server (0) | 2022.12.22 |
---|---|
체성분 측정기 데이터 관리 (0) | 2021.07.30 |
CUBRID 설치 (0) | 2021.06.27 |
Cubrid 설치 & 실행 (0) | 2021.03.08 |
MySQL (0) | 2021.03.06 |