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

People are also looking for solutions to the problem: mysql - Passing user id from the WP session to another PHP session

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.