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