[eluser]raymondS[/eluser]
class Xxx extends Controller
{
public function __construct()
{
parent::Controller();
}
public function index()
{
$config['hostname'] = "localhost";
$config['username'] = "root";
$config['password'] = "";
$config['database'] = "xxx";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";
$this->load->database($config);
//this will get 2 rows of object
$rows_of_object = $this->db->query("SELECT * FROM content");
//this will get an array with those objects as it's value
$array_of_object = $rows_of_object->result();
$data;
for($i=0;$i < ( $rows_of_object->num_rows() );$i++)
{
$data[$i] = $array_of_object[$i];
}
//It works here
print_r ($data[1]->content_title);
$this->load->view('Xxx_view', $data);
}
}
// The View, Doesn't Work at all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $content_title ?></title>
</head>
<body>
<div id="container">
<?php echo $content_value; ?>
</div>
<hr />
</body>
</html>
HELP!!!!