Welcome Guest, Not a member yet? Register   Sign In
How to display record based on their ID?
#1

(This post was last modified: 07-18-2016, 02:31 AM by theromie.)

This is my index.php file
<a itemprop="title" style="text-transform: capitalize;color:#29aafe" href="<?=site_url('jobdetails/#'.$row->JPostID);?>"><?=$row->JTitle;?></a>

This is my model.php
public function getRowByJob($id){
     
$this->db->select('*');
            $this->db->from('jobs');
            $this->db->where('JPostID', $id);
            $query = $this->db->get();

            if($query->num_rows() > 0)
                return $query;
                   
}

This is my controller.php
public function jobdetails(){
   
$data = array();
    $id = $this->input->get('id');
   $data['jobdata'] = $this->mymodel->getRowByJob($id); // it is model method to fetch the record of that users having id = $id
   $this->load->view('jobdetails',$data);
 
}

This is my jobdetails.php
<?php                         
                        foreach($jobdata as $row){?>                                        
                     <div class="block-section box-item-details" itemscope itemtype="http://schema.org/JobPosting">
                        <h2 class="title" itemprop="title" style="text-transform: capitalize;"><?=$row->JTitle;?></h2>
</div>
theromie
Reply


Messages In This Thread
How to display record based on their ID? - by theromie - 07-18-2016, 12:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB