I am trying to get my user information from "profile_details" table and display in on profile.php view. Here is my Profile.php controller which just display the view for now
<?php
class Profile extends CI_Controller
{
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->view('admin/profile/index');
}
}
And here is profile_model.php
<?php
class Profile_model extends CI_Model
{
//table name: profile_details
public function __construct()
{
parent::__construct();
}
function myProfileDetails($username)
{
$query=$this->db->query('SELECT * FROM profile_details WHERE username = $username');
//$this->db->select('*');
//$query= $this->db->get('customer');
return $query->result();
}
}
And here is my view (profile) index.php
<div class="tab-content profile-tab" id="myTabContent">
<div class="tab-pane fade show active" id="About" role="tabpanel" aria-labelledby="home-tab">
<div class="row">
<div class="form-group col-md-6">
<label>First Name</label>
<span class="form-control"></span>
</div>
<div class="form-group col-md-6">
<label>Last Name</label>
<span class="form-control">3</span>
</div>
<div class="form-group col-md-6">
<label>Email Id</label>
<span class="form-control">f</span>
</div>
<div class="form-group col-md-6">
<label>Phone</label>
<span class="form-control">f</span>
</div>
<div class="form-group col-md-6">
<label>Sub-Company Name</label>
<span class="form-control">g</span>
</div>
<div class="form-group col-md-6">
<label>Role</label>
<span class="form-control">t</span>
</div>
</div>
</div>
And below is profile_details table
Can you please help me how could i get the informations display in my view.