Welcome Guest, Not a member yet? Register   Sign In
Show database results in a table
#2

[eluser]sofwan[/eluser]
You can try :

in your controller :
function view_table()
{
$query = "select name from student";
$data['resultx']=$this->db->query("$query");
$this->load->view('view_student',$data);
}

in your view (view_student.php)
<?
foreach ($resultx->result() as $row)
{
echo $row->name."<br /> ;
}
?&gt;


Messages In This Thread
Show database results in a table - by El Forum - 11-20-2009, 10:28 PM
Show database results in a table - by El Forum - 11-20-2009, 11:10 PM
Show database results in a table - by El Forum - 11-21-2009, 12:18 AM
Show database results in a table - by El Forum - 11-21-2009, 01:27 AM
Show database results in a table - by El Forum - 11-21-2009, 08:43 AM
Show database results in a table - by El Forum - 11-21-2009, 10:29 AM
Show database results in a table - by El Forum - 11-21-2009, 07:02 PM
Show database results in a table - by El Forum - 11-22-2009, 06:58 AM
Show database results in a table - by El Forum - 09-28-2012, 07:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB