Hello friends I have a problem that I have been struggling with in the last few hours, it turns out that I have to graph the conversations that have not been answered, and these are the catalog from mysql, in a way:
one day, 3 days, 1 week, and one month, I give the example that I have 417 one-month conversations that have not been answered now I will show the sql sentences I use to get the intervals;
SELECT count(conver.ID_CONVERSACION) as inbox_un_dia from mensaje as msj
INNER JOIN conversacion as conver on msj.conversacion_id_conversacion = conver.ID_CONVERSACION where msj.created_time = conver.UPDATED_TIME
and msj.id_from <> $id_pagina and conver.pagina_ID_PAGINA = $id_pagina and msj.created_time between DATE_SUB(NOW(),INTERVAL '1' DAY) and NOW() ORDER BY conver.ID_CONVERSACION
SELECT count(conver.ID_CONVERSACION) as inbox_tres_dias from mensaje
as msj INNER JOIN conversacion as conver
on msj.conversacion_id_conversacion = conver.ID_CONVERSACION where msj.created_time = conver.UPDATED_TIME
and msj.id_from <> $id_pagina and conver.pagina_ID_PAGINA = $id_pagina and msj.created_time between
DATE_SUB(NOW(),INTERVAL '3' DAY) and NOW() ORDER BY conver.ID_CONVERSACION
SELECT count(conver.ID_CONVERSACION) as inbox_una_semana from mensaje
as msj INNER JOIN conversacion as conver
on msj.conversacion_id_conversacion = conver.ID_CONVERSACION where msj.created_time = conver.UPDATED_TIME
and msj.id_from <> $id_pagina and conver.pagina_ID_PAGINA = $id_pagina and msj.created_time between
DATE_SUB(NOW(),INTERVAL '1' WEEK) and NOW() ORDER BY conver.ID_CONVERSACION
ok friends now my problem is this, when the conversations of a day are created, this is all great, but when I have for example 3 days it shows me 48 which in reality only belong 18 messages because it takes me the 1st day, and what I need is how to send the parameter to the between, in advance I would greatly appreciate it, since I am new to this: $