Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select Customer add branch address heaing
11-12-2015, 01:43 AM,
#1
Select Customer add branch address heaing
Hi All
I am trying to add the Customer branch braddress1 the heading when a customer is selected I can get this to work in place of the phone number but I would like them both.
The issue is with the sql select statement see below

if ($_SESSION['CustomerID'] != '' AND !isset($_POST['Search']) AND !isset($_POST['CSV'])) {
if (!isset($_SESSION['BranchCode'])) {
$SQL = "SELECT debtorsmaster.name,
custbranch.braddress1
custbranch.phoneno
FROM debtorsmaster INNER JOIN custbranch
ON debtorsmaster.debtorno=custbranch.debtorno
WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "'";

} //!isset($_SESSION['BranchCode'])
else {
$SQL = "SELECT debtorsmaster.name,
custbranch.braddress1
custbranch.phoneno
FROM debtorsmaster INNER JOIN custbranch
ON debtorsmaster.debtorno=custbranch.debtorno
WHERE custbranch.debtorno='" . $_SESSION['CustomerID'] . "'
AND custbranch.branchcode='" . $_SESSION['BranchCode'] . "'";
}
$ErrMsg = _('The customer name requested cannot be retrieved because');
$result = DB_query($SQL, $ErrMsg);
if ($myrow = DB_fetch_array($result)) {
$CustomerName = htmlspecialchars($myrow['name'], ENT_QUOTES, 'UTF-8', false);
$PhoneNo = $myrow['phoneno'];
$BrAddress1 = $myrow['braddress1'];


Any help would be appreciated
Thanks For All The Great Work
Dave
Reply


Messages In This Thread
Select Customer add branch address heaing - by daveparrish - 11-12-2015, 01:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)