<?php
include_once("../php/config.php");
$a = mysql_query("select sum(balance) as balance from ventas where cliente='".$_GET['cliente']."' and balance>0 and termino='Credito'") or die(mysql_error());
$b = @mysql_result($a, 0,"balance");
if($b==""){
    $b = 0;
}
echo $b;
?>