Hello,I am using PHP Codeignetor. and I can't retrive row/single data information from table.But here data save successfully.
here is the CI_Model code:

public function selectItinfoByUserId($user_id) {
        $this->db->select('*');
        $this->db->from('tbl_add_it_ins_course');   // table name
        $this->db->where('user_id', $user_id);
        //$this->db->where('contact_status', 0);
        $query_result = $this->db->get();
        $result = $query_result->result();
        return $result;
    }

/* End Model*/

Here Is the CI_Controller:<<< SAVE INPUT DATA INFO INTO TABLE >>>

public function saveItInscourse(){
        $data = array();
        $data['it_ins_profile'] = $this->input->post('it_ins_profile', true);
        $data['it_ins_advantage'] = $this->input->post('it_ins_advantage', true);
        $data['it_office_phon'] = $this->input->post('it_office_phon', true);
        $data['it_fax'] = $this->input->post('it_fax', true);
        $data['it_contact_time'] = $this->input->post('it_contact_time', true);
        $data['it_email_address'] = $this->input->post('it_email_address', true);
        $data['it_office_address'] = $this->input->post('it_office_address', true);
        $data['it_location'] = $this->input->post('it_location', true);
        $data['it_fb_fanpage'] = $this->session->userdata('it_fb_fanpage', true);
        $data['it_website'] = $this->session->userdata('it_website', true);
        //$user_id = $this->session->userdata('user_id');
        $data['result']=$this->user_admin_model->saveItInsInfoByUser($user_id);  
        redirect("user_admin_controller/selectItCourses");
        }

/* End CI_Controller */

Now,please help me how can i retrive row/single information data from table.
here is the desired page code please see and please correction here:

<html>
    <head>
        <title><?php if (isset($title)) {
    echo $title;
} ?></title>
    </head>
    <body>
            <h3>Institut Information</h3>
        <table>
<?php 

{

             foreach ($result as $row){

    ?>
                <tr>
                    <th>Institute Profile</th>
                    <td>: <?php echo $row->it_ins_profile;?></td>
                </tr>
                <tr>
                    <th>Facilities Of Institute</th>
                    <td>: code </td>
                </tr>
                <tr>
                    <th>Office Phone</th>
                    <td>: code </td>
                </tr>
                <tr>
                    <th>Fax</th>
                    <td>: code </td>
                </tr>
                <tr>
                    <th>Office Contact Time</th>
                    <td>: code </td>
                </tr>
                <tr>
                    <th>Email Address</th>
                    <td>: code </td>
                </tr>
                <tr>
                    <th>Office Address</th>
                    <td>: code </td>
                <br/>
            </tr>
            <tr>
                    <th>Location</th>
                    <td>: code </td>
                <br/>
            </tr>
            <tr>
                    <th>Facebook Facepage</th>
                    <td>: code </td>
                <br/>
            </tr>
            <tr>
                    <th>Website(url)</th>
                    <td>: code </td>
                <br/>
            </tr>
        </table>
<?php }}
?>

</body>
</html>

Change line 14 in your controller, from this:

$data['result'] = $this->user_admin_model->saveItInsInfoByUser($user_id);

to this:

$data['result'] = $this->user_admin_model->selectItinfoByUserId($user_id);

bye!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.