In my project i am trying to select an id field and a varchar field from a database and i want to return a 2 dimentional array containing the id fields and the varchar fields.This is what i have done:
foreach($dbh->query("SELECT status, post_id FROM status WHERE user_id = " . $user_id) as $row_all){
$ret_array[] = $row_all;
}
return @$ret_array;
When i print the value on another page:
foreach ($all_stats as $key => $value) {
foreach ((array)$value as $post_id => $status) {
echo $status;
}
}
When it is printed on the page i get:
"Second post" 1 1
I would like to print only value that is held in the status part of the array. Hope someone can help.