I am trying to send 2 values from cx_card to my getproduto.php. For this I am using ajax
The variable values:
com_id=1
cliente_id=3440
The form select:
<select width="200" name="produto" id="produto-list" class="produtoInputBox" onChange="getsubproduto(this.value);" <?php echo $permissao; ?>>
ajax code
function getproduto(val,val_id) {
$.ajax({
type: "POST",
url: "inc/cx/get_produto.php",
data:'com_id='+val+'&cliente='+val_id,
success: function(data){
$("#produto-list").html(data);
}
});
}
My Query in getproduto.php
$query ="SELECT * FROM apolices WHERE id_cliente='".$_POST['cliente_id']
."' and id_companhia = '".$_POST['com_id']."'";
$results = $db_handle->runQuery($query);
In cx_card i have print the query i have recibe from getproduto.php the result is:
SELECT * FORM apolices WHERE id_cliente='undefined' and id_companhia='1'
Thanks for the help.