From 3a5ba00a52bb9671fb158e542fbff983e87f4a5c Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 21 Sep 2021 23:44:45 -0400 Subject: [PATCH] Fix Add Photo under add location --- post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index a577cd9a..87cea95a 100644 --- a/post.php +++ b/post.php @@ -3638,9 +3638,10 @@ if(isset($_POST['add_location'])){ mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_country = '$country', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_notes = '$notes', location_contact_id = $contact, location_created_at = NOW(), location_client_id = $client_id, company_id = $session_company_id"); + $location_id = mysqli_insert_id($mysqli); + //Update Primay location in clients if primary location is checked if($primary_location > 0){ - $location_id = mysqli_insert_id($mysqli); mysqli_query($mysqli,"UPDATE clients SET primary_location = $location_id WHERE client_id = $client_id"); }