I need to print/show list of comments for articles using this PHP function:
function _is_comments_($id,$type){
$db = mysqli_access::F("SELECT message FROM " . COMMENTS . " WHERE pid = ? AND type = ? AND approved = 1 ", $id, $type);
foreach($db as $row){
$commentdata['message'] = $row['message'];
}
return $commentdata;
}
In action :
$comments_list = _is_comments_('125','article');
print_r($comments_list);
In result :
Array ( [message] => this is a One comment )
But in MySQL database I have 18
comments for article id 125
and my result is false and show only One result!
how do fix This ?!