I had tried following thing.
<?php
$servername = "127.0.0.1:3307"; //localhost
$username = "root";
$password = "";
// Create connection
$conn = new mysqli($servername, $username, $password);
try {
$conn = new PDO("mysql:host=$servername;dbname=test", $username,$password);
// set the PDO error mode to exception
echo "Connected successfully";
$sql = "INSERT INTO test.senrdata (temp) VALUES (".$_GET["value"].")";
echo "query " . $sql ;
$conn->exec($sql);
// Execute SQL statement
}
?>
I had tried Arduino code which gives sensor data and store this data on server.