I am comparing the data of these two tables pontos
and pontos_view
in practice, in the pontos
table there is a list of tasks that when executed by the user, saved in pontos_view
thus causing the user to not execute the same task.
$this->container->database->query("
SELECT id,public,ponto
FROM pontos p
WHERE NOT EXISTS(
SELECT id_point_public,date_view FROM pontos_view v
WHERE p.public = v.id_point_public AND v.id_us=:idUser) LIMIT 20",
[
':idUser' => $_SESSION['user_id']
])->fetchAll();
But I need to limit the amount of tasks of the day. -I thought of something like: use the date_view
field of the pontos_view
table and count the tasks performed in the day compared to the current date and a limit ..
If the user has performed 20 tasks today registered in the pontos_view
table does not display anything else ..
Does anyone know how it would be possible to do this?