I just started to using the Kohana framework and I'm trying to execute a few queries, but after spending a couple hours in documentation and running some tests all I have is this:
class Controller_Test extends Controller {
public function action_index()
{
$query = DB::select()->from('test')->where('test', '=', '1');
echo $query
}
}
Now, if try to run this all it does is echo my SQL.
How do I get the actual data from my database? I know that I could do something like:
$row = mysql_fetch_row(mysql_query($query));
echo $row[0];
and it would work; but I guess that's just completely stupid, since I'm using a framework and there has to be built-in method(s) for this.