D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
get-contact-details.php
back
Copy
<?php include 'config.php'; // $id = $_GET["companyId"]; // $result = "<option value=''>--Select--</option>"; // $invoiceNumber = 0; // $getCustomerAddress = "SELECT * FROM `contact_address` WHERE contact_id = '$id'"; // $resultGetCustomerAddress = mysqli_query($conn, $getCustomerAddress) or die("error"); // if($resultGetCustomerAddress){ // if(mysqli_num_rows($resultGetCustomerAddress) > 0){ // while($rowGetCustomerAddress = mysqli_fetch_assoc($resultGetCustomerAddress)){ // $addressId = $rowGetCustomerAddress["id"]; // $address = $rowGetCustomerAddress["address"]; // $city = $rowGetCustomerAddress["city"]; // $state = $rowGetCustomerAddress["state"]; // $country = $rowGetCustomerAddress["country"]; // $result .= "<option value='".$addressId."'>".$address.", ".$city.", ".$state.", ".$country."</option>"; // } // } // } // echo $result; $addressId = $_GET["companyId"]; $sqlGetAddress = "SELECT * FROM contact_address a left join contact b on a.contact_id = b.id WHERE a.id = '$addressId'"; $resultGetAddress = mysqli_query($conn, $sqlGetAddress); if($resultGetAddress){ if(mysqli_num_rows($resultGetAddress) > 0){ $row = mysqli_fetch_assoc($resultGetAddress); echo json_encode($row); } } ?>