开始学习Kohana3.3&现在我坚持将数据库中的数据显示在我的索引页面上。
APPPATH / classes / Controller / Hellp.php:
<?php defined('SYSPATH') OR die('No Direct Script Access');
Class Controller_Hello extends Controller_template
{
public $template = 'site';
public function action_index()
{
$msg1 = "Above Value";
$this->template->msg ="H W !!!!!" ;
echo $msg1;
// Database query
$query = DB::query(Database::SELECT, 'SELECT * FROM users')->execute();
echo $query[1];
}
}
APPPATH / View / site.php:
<html>
<head>
<title>We've got a message for you!</title>
<style type="text/css">
body {font-family: Georgia;}
h1 {font-style: italic;}
</style>
</head>
<body>
<h1>
<?php echo $msg; ?>
</h1>
<p>We just wanted to say it! :)</p>
<?php echo $query; ?>
</body>
</html>
以下是错误:
ErrorException [注意]:数组转换为字符串
请帮助解决两件事:
谢谢!