Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Print out all data
MaxG
August 2013
Hey,
i have an database structure like this:
id | link | alias | parent
--------------------------------
1 | abc | abc | 0
2 | abc | abc1 | 1
how can i print just all aliases out? So that i have an array like array('alias' => 'abc', 'alias' => 'abc1');
This dont work with:
$query = DB::select('*')->from('navigation')->execute()->as_array();
foreach($query as $key => $val){
foreach($val as $key => $val){
echo $val['alias'];
}
}
Harro
August 2013
you can do
->as_array('id', 'alias')
which will give you an indexed array with id => alias
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
August 2013