Upload files to 'mysql_php'

This commit is contained in:
2018-06-30 10:55:46 +02:00
parent 1ade4137f8
commit 89d4df5524
5 changed files with 1027 additions and 0 deletions

28
mysql_php/upload.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
if ( isset($_GET["m"])) { $m = $_GET["m"]; } else { exit(); }
if ( isset($_GET["t"])) { $t = $_GET["t"]; } else { exit(); }
if ( isset($_GET["p"])) { $p = $_GET["p"]; } else { exit(); }
if ( isset($_GET["f"])) { $f = $_GET["f"]; } else { exit(); }
$link = mysqli_connect("localhost", "xxxxxxx", "xxxxxxx", "$m");
if (mysqli_connect_errno()) {
exit();
}
/* Prepare an insert statement */
$ins = "INSERT INTO $m (time, temperature, pressure, humidity) VALUES (now(),?,?,?);";
$stmt = mysqli_prepare($link, $ins);
mysqli_stmt_bind_param($stmt, "ddd", $t, $p, $f);
/* Execute tne statement */
mysqli_stmt_execute($stmt);
/* close statement */
mysqli_stmt_close($stmt);
/* close connection */
mysqli_close($link); // close connection
?>