dimanche 1 octobre 2017

CodeIgniter using if to show some table

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);

}

Model

  public function dataz()
{
        $query = $this->db->get('info');
        $results = $query->result();    
        return $resultss;
}

View

<?php
              foreach($resultss as $row) {
                echo '<tr>';
                echo '<td>'.$row->name.'</td>';
                echo '<td>'.$row->note.'</td>';                  
                ?><td>                                   
                </td><?php
                echo '</tr>';
                }?>

Any help would be appreciated!

Aucun commentaire:

Enregistrer un commentaire