I want to show my database every 3 seconds without refreshing the page.
I wrote this code but I could not send SQL to the controller.

Could anyone help me please?

```js
$( document ).ready(function() {

  function get_fb(){
    var a='';
    $.ajax({
              url : "{{URL::action('DataController@post_appajax')}}",
              type : "POST",
              data : { a : a}
            })
            .done(function(json){
                console.log(json);
            });

    }
setInterval(function(){get_fb();}, 3000);
});
        </script>

```

```html
public function post_appajax()
{

    if(isset($_POST['a'])) {
        $data = DB::select('SELECT * FROM catetory');
        return View::make('data.index')
        ->with('data', $data);
    }

}

```