MySQL date range if data not available display 0
You should use a RECURSIVE CTE  available in Mysql8.0 and above.

WITH RECURSIVE abc AS (
  select CAST('2020-01-01' as DATE) as a 
  union all 
  select ADDDATE(a,interval 1 day) 
  from abc where a&lt;'2020-01-31')     
SELECT * FROM abc;


Above will output all dates between '2020-01-01' and '2020-01-31'.

If you join this to your query, you should see 0 for dates that have no value in your table.

WITH RECURSIVE abc AS (
  select CAST('2020-01-01' as DATE) as a 
  union all 
  select ADDDATE(a,interval 1 day) 
  from abc where a&lt;'2020-01-31')
select SUM(x.jumlah), x.tanggal  from (
select 
 count(id) as jumlah,
 tanggal 
from tb_trafik_berita 
WHERE (tanggal BETWEEN '2020-01-02 00:00:00' AND '2020-01-07 23:59:00') 
group by tanggal
union all 
select 0,a from abc
) x 
GROUP BY x.tanggal