This question already has an answer here:
I've been getting the error:
mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in (directory) on line 8
I've looked in to multiple causes that other people have posted for the same issue but haven't had any luck with those solutions. This may be a duplicate so I apologize if it is but I went through a good chunk of the posts for this and haven't found the solution.
$conn = mysqli_connect($servername, $username, $password, $db); $selected_db = mysqli_select_db($conn, $db); $zip = $_POST['zip']; $sqlq1 = "SELECT * FROM customMap WHERE zip = $zip"; $query = mysqli_query($conn, $sqlq1); $array = mysqli_fetch_assoc($query); $location = mysqli_fetch_array($array['Name']); $address = mysqli_fetch_array($array['Address']); print_r($location); print_r($address);
Thanks in advance for any advice you might have.