[eluser]kalelgwapo[/eluser]
i already know how to input data into my database but i just couldnt get it to display the info. I'm stuck in reading the user_guide and i dont know what to do, here's my codes from my view, model and controller.
from the controller (i tried to test and input the $username if it will display in the views, but it doesnt)
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Profilepage extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$username = $this->input->post('username');
$this->load->model('Profile');
$this->Profile->getinfo($username);
$this->load->view('profile');
}
}
from the views
Code:
<form name="form1" method="post" action="">
<div>
<div align="center"><a href="profilepic"><img src="CI doesnt allow me to post links" width="120" height="120" alt="Photo Here" /></a></div>
</div>
<?php echo $username?>
<div><p>Name:<?php echo $firstname?> <?php echo $lastname?></p>
<p>Email Address:<?php echo $email?></p>
<p>Birthdate:<?php echo $bday?></p>
<p>Messages</a></p>
<p>Friends</a></p></div>
</form>
and from the model
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Profile extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function getinfo($username)
{
$dsn = 'CI doesnt allow me to post links';
$this->load->database($dsn);
$query = $this->db->query("select username from users");
return $firstname = $query->row();
}
}
?>
im fairly a beginner in CI and doesnt understand it much, i hope you can help me