<?php
include 'conn.php';

session_start();
$_SESSION['database'] = $_POST['database'];

$montoesql="SELECT (cod_client_valor + 1) AS cValue FROM ".$_SESSION['database'].".empresas WHERE emp_id=1 LIMIT 1";

$qur = $connection->query($montoesql);
$msg = array("cValue" => "0");
while($r = mysqli_fetch_assoc($qur))
{
	$msg =  array("cValue" => $r['cValue']);
}
$jsonData[] =$msg;  

header('content-type: application/json');
echo json_encode($jsonData);


@mysqli_close($connection);

?>