So i am trying to make a website for collecting data from user and classify the data as 'suspicious' or 'not suspicious'. After i collect and classify the data, i want to show and send to server ONLY 'suspicious' data.
My table has one column called 'note', where the value of the 'note' is 'suspicious' or 'not suspicious'
is it possible to show the part of table that only have 'not suspicious' value in 'note' ? if possible, can you guys give me any idea how ?
Here is my code for showing the data:
Controller:
public function success() {
$dataz['resultss'] = $this->welcome_model->dataz();
$this->load->view('success',$dataz);
}
public function dataz() {
$query = $this->db->get('info');
$results = $query->result();
return $resultss;
}
<?php
foreach($resultss as $row) {
echo '<tr>';
echo '<td>'.$row->name.'</td>';
echo '<td>'.$row->note.'</td>';
?>
<td>
</td>
<?php
echo '</tr>';
}
?>
You can achieve your objective in many ways.
For 'not suspicious' records, use this,
$query = $this->db->get_where('info', array('note' => 'not suspicious'));
For 'suspicious' records, use this,
$query = $this->db->get_where('info', array('note' => 'suspicious'));