json - Error in foreach php
26
function CheckSourceInfoOne($source) {
foreach ($array as list($a, $b, $c)) {
list($latitude, $longitude) = explode(',', $c);
$La = mysqli_query($dbc, "SELECT * from Spotting_TB WHERE latitude = '".$latitude."'");
$Lo = mysqli_query($dbc, "SELECT * from Spotting_TB WHERE longitude = '".$longitude."'");
if ($checkLatitude == false && $checkLongitude == false) {
if ($insert = $dbc->query("INSERT INTO Spotting_TB (spotting_number,P,longitude,latitude,I,time_posted,hidden) VALUES (NULL,'{$b}','{$Lo}','{$La}','0',NOW(),'0')")) {
}
}
}
}
I have been trying everything and i cant find out my error in the code :/ Its suposed to take a decoded json and go through it and post it if its not in the database but its not working