I'm beginner at PHP & MYSQL I don't know where is the error at this code first MySQL database contains 6 tables I've no equation to JOIN them together and I want to show the last added value of each table
<?php
$servername = "localhost";
$username = "project";
$password = "pro2018";
$dbname = "project";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql_temp = "select * from temp order by id desc limit 1 ";
$sql_hum = "select * from hum order by id desc limit 1 ";
$sql_soil1 = "select * from soil1 order by id desc limit 1 ";
$sql_soil2 = "select * from soil2 order by id desc limit 1 ";
$sql_soil3 = "select * from soil3 order by id desc limit 1 ";
$sql_soil4 = "select * from soil4 order by id desc limit 1 ";
$result_temp = $conn->query($sql_temp);
$result_hum = $conn->query($sql_hum);
$result_soil1 = $conn->query($sql_soil1);
$result_soil2 = $conn->query($sql_soil2);
$result_soil3 = $conn->query($sql_soil3);
$result_soil4 = $conn->query($sql_soil4);
//if ($result_->num_rows > 0) {
// output data of each row
$row_temp = $result_temp->fetch_assoc()) ;
$row_hum = $result_hum->fetch_assoc()) ;
$row_soil1 = $result_soil1->fetch_assoc()) ;
$row_soil2 = $result_soil1->fetch_assoc()) ;
$row_soil3 = $result_soil1->fetch_assoc()) ;
$row_soil4 = $result_soil1->fetch_assoc()) ;
$x = $row_temp["value"];
$y = $row_hum["value"];
$a = $row_soil1["value"];
$b = $row_soil2["value"];
$c = $row_soil3["value"];
$d = $row_soil4["value"];
echo " $x" . " Degree";
echo " $y" . " %";
echo " $a" . " %";
echo " $b" . " %";
echo " $c" . " %";
echo " $d" . " %";
header("Refresh:5");
?>