According to the MVC
pattern your queries must be executed by the Model
layer. MVC
is a very popular standard and widely applied these days. It is a standard and can be replaced by others.
However it is strongly recommended that you follow some pattern, so if someone else maintains your code you will have a little less difficulty understanding it, and even yourself.
In line with MVC
it is interesting to follow other good programming practices, such as: DRY , SOLID and others.
Good practices serve to make our code more human-readable, making it easier to maintain and extend the project lifecycle.
The big difference in the place where the query is executed is in the project organization.
As for the issue of changing the project, I believe only you can answer that.
If you are free to start the project again, I recommend you look at Laravel , which is a php framework that applies MVC
. I recommend it for the wide community membership and ease of finding material.