Filter with 2 conditions ajax

0

Good afternoon guys, I have a filter in ajax that filters 1 result only. I need to filter two conditions, type month and name of a person in a calendar table. How can I do it?

    <script type="text/javascript">
    $('#show_pessoa'),('#mes-agenda').change(function () {
        var chars = (this.value);
        var chars2 = (this.value);
        $.post('../Ajax/pessoa_agenda', {val: chars, val2: chars2}, function (busca) {
            $('#content-left').html(busca);
        });
    });
</script>

        $char = $_POST['val'];
        $char2 = $_POST['val2'];
        $dados = connection::select("Select * from agenda where pessoa= '" . $char . "' and mes = '" . $char2 . "'");
    
asked by anonymous 17.06.2016 / 19:31

0 answers