I have following problem:

View:

```
<script>
        function show(id) {

            $.ajax({
                url: '<?php echo site_url('index.php/controller/show_id'); ?>',
                dataType: 'json',
                data:({id: id}),
                type: "POST",
                success: function (data) {
                    alert( data.user_id);
                }

            });
        }

        </script>

```

Controller:

```
function show_id(){

            $id= $this->input->post('id');
            $id_list = $this->id_model->show_id($id);   
            $data['id'] = $id_list;
            if($data['id']){   
                 echo json_encode( $data['id'] );
            } else {
                 echo json_encode( array('error' => true) );
            }   
        }

```

If I load the page, I got "undefined" as an alert.
If I change the JS to "alert(data);" I receive all content of the sql table.   

How do I have to change the JS to get only "user.id" column?