What I am trying to do is check with fetch_assoc() some column of rows of table Warning. Then if those checks are correct I would like to insert into another table DataTable values of some columns of the rows of Warning. This is my code:
$conn= mysqli_connect("localhost","root","root");
$query = "SELECT Addr, Pol FROM Warning";
if ($result = mysqli_query($conn, $query)) {
while($row=mysqli_fetch_row($result)) {
if(($row['Addr']>=5) && ($row['Pol']<=15))
{
$sql= " INSERT INTO DataTable(Info,Valuesop,Dataop) SELECT (Number,Valuessom,Transf) FROM Warning ";
$conn->query($sql);
echo "yes";
}
else
{
echo "no";
}
}
}