How to get your data from a select statement in Kohana?

uzeyirx

New Member
If I have this code (which is from their docs)\[code\]$query = DB::query(Database::SELECT, 'SELECT * FROM users WHERE username = :user');$query->param(':user', 'john');$query->execute();\[/code\]How would I access the actual data returned from this?I am looking for an associate array containing \[code\]$array['username']\[/code\] and whatever other columns are on the \[code\]users\[/code\] table. I have tried:\[code\]#1echo $query->execute();#2$row = $query->execute();echo $row['username'];#3$query->fetch();\[/code\]None of which work. What am I missing?
 
Back
Top