I have this function for show tags list :
$DB_QUERY = Access::FETCH("SELECT name, " . NEWS_TAGS . ".id,tags_id,content_id FROM " . NEWS_TAGS . " JOIN " . NEWS_POSTS_TAGS . " ON
" . NEWS_TAGS . ".id = " . NEWS_POSTS_TAGS . ".tags_id WHERE " . NEWS_POSTS_TAGS . ".content_id = ? AND " . NEWS_TAGS . ".type = ? ORDER BY " . NEWS_TAGS . ".name ASC LIMIT 8 ", filter_var($id, FILTER_VALIDATE_INT) , $type);
$ret = array();
foreach($DB_QUERY as $row)
{
$ret[] = $row['name'];
}
$tags = '<li class="label"><a href="#"><i class="fa fa-tag"></i>' . $ret . '</a></li>';
echo $tags;
But i see this error :
Notice: Array to string conversion in C:\xampp\htdocs\frontcms\class\functions.php on line 449
EDIT:
I print result print_r($DB_QUERY)
using PHP print_r
:
Array(
[0] => Array(
[name] => 321[id] => 393[tags_id] => 393[content_id] => 244
) [1] => Array(
[name] => tagname1[id] => 395[tags_id] => 395[content_id] => 244
) [2] => Array(
[name] => tagname2[id] => 394[tags_id] => 394[content_id] => 244
) [3] => Array(
[name] => tagname3[id] => 396[tags_id] => 396[content_id] => 244
)
)
how do fix this ?!