How do I select all the records in the select below:
$select = "SELECT COUNT(1) AS id_mark, SUM(a.rate) AS rate, b.name_mark, b.id
FROM tb_comment a, tb_mark b
WHERE a.id_mark=b.id AND b.id_category=:id_c
GROUP BY a.id_mark, b.name_mark
ORDER BY rate DESC
LIMIT $start_pg, $amount_pg";
Because in this SELECT you are just selecting 'items' that have some value at 'rate' , you would not be able to select everything and those that have no value show '0' as value?
In the tb_mark table you have all the records * [topics] * and in the tb_comment table you have all the comments records of the topics , and the select is only displaying the records that have some record in the tb_comment table.