how do i get the data from view in codeigniter
<p>I'm not good in codeigniter i'm still learning this. So i need your help guys.</p>

<p>I want to get the data from the database that the id is equal to the value of the dropdown list button.so heres is my code.</p>

<p>This is my controller: <strong>controller.php</strong></p>

<pre><code>function getdataload(){
     $this-&gt;load-&gt;view('data',$data);
}
</code></pre>

<p>I really don't know what to put in the controller.</p>

<p>This is my view: <strong>view.php</strong></p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;label for="member"&gt;Member&lt;/label&gt;
            &lt;select class="form-control" id="member" name="member" required onchange="showCustomer(this.value)"&gt;
              &lt;option selected="" value=""&gt;--select--&lt;/option&gt;
                 &lt;?php foreach ($members as $row): ?&gt;
              &lt;option value="&lt;?php echo $row-&gt;mem_id; ?&gt;"&gt;&lt;?php echo ucwords($row-&gt;mem_fname.' '.$row-&gt;mem_lname) ?&gt;&lt;/option&gt;
               &lt;?php endforeach ?&gt;
            &lt;/select&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;script&gt;
$('#member').on('change',function(){
    $.post('&lt;?php echo base_url("transactions/getdataload")?&gt;',
        {
            mem_id:$(this).val()
        }).done(function(res)
        {
        $('#select_member').text(res);
    });
});
&lt;/script&gt;
</code></pre>

<p>This is the other view that the called from the controller <strong>data.php</strong></p>

<pre><code>&lt;?php

$q = intval($_GET['member']);

$con = mysqli_connect('localhost','root','','global89_point');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,"global89_point");

$sql="SELECT * FROM loading_service WHERE member='".$q."'";
$result = mysqli_query($con,$sql);

echo "&lt;table&gt;";
echo "&lt;tr&gt;";
echo " &lt;th&gt;";
echo "Member ID";
echo "&lt;/th&gt;";

echo "&lt;/tr&gt;";

while($row = mysqli_fetch_array($result)) {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['member'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
}
echo "&lt;/table&gt;";
mysqli_close($con);

?&gt;
</code></pre>

<p>please help me with this guys.</p>