<?php
include "../dbconfig.php";
//include "../dbfunction.php";
//print_r($_POST);
//
//$company_data=$_POST;
$id=$_POST['id'];
//$where='id='.$id;
//$update_company =update($con,"customers",$company_data,$where);
$name=$_POST['name'];
$phone=$_POST['phone'];
$address1=$_POST['address1'];
$post_code=$_POST['post_code'];
$email=$_POST['email'];
$balance=$_POST['balance'];
//$client_reference=$_POST['client_reference'];
//mysqli_query($con,"UPDATE customers SET name ='$name',phone='$phone',address1='$address1',post_code='$post_code',email='$email',client_reference='$client_reference' WHERE id='$id'");
//$sql="UPDATE creditors SET name ='$name',balance='$balance' WHERE source_id='$id'";

mysqli_query($con,"UPDATE customers SET name ='$name',phone='$phone',address1='$address1',post_code='$post_code',email='$email' WHERE id='$id'");
$sql="UPDATE creditors SET name ='$name',balance='$balance' WHERE source_id='$id'";
     //exit; 
if (!mysqli_query($con,$sql))
  {
  echo("Error description: " . mysqli_error($con));
  exit;
  }
  echo "success";
?>