<?php
require_once('functions.php');

  $dbc=mysqli_connect('localhost','wqvsodvt_porr','@@W!QSER765VBlkj@@@!!','wqvsodvt_point');


$name=mysqli_real_escape_string($dbc,trim($_POST['name']));
$phone=mysqli_real_escape_string($dbc,trim($_POST['phone']));
$id=$_POST['id'];
//$limit=$_POST['limit'];
//$opening=$_POST['opening'];
//	$results = mysqli_query($dbc,("SELECT credit FROM ledgers WHERE froms= '$id' and description='OPENING BALANCE'"));
//					     $nj=mysqli_fetch_array($results);
//						    $open=$nj['credit'];
mysqli_query($dbc,("UPDATE accounts set name='$name',phone='$phone' where id='$id'"));
//mysqli_query($dbc,("update ledgers set credit='$opening' where froms='$id' and description='OPENING BALANCE' and credit='$open' limit 1"));
//mysqli_query($dbc,("update ledgers set debit='$opening' where account_id='$id' and description='OPENING BALANCE' and debit='$open' limit 1"));
  header("location: suppliers.php");
		


mysqli_close($dbc);

	
?>