[eluser]aquary[/eluser]
(1)
Normally, my controller do:
- Request models to pull data from database.
- Retrieve posted data.
- Sending request to other services, and vice versa.
- do some form validation (this could be in a model)
- redirect to some other pages
- Business logic/flows
- etc. anything not related to "Direct access to database" nor "Showing something to the user".
(2)
Just try to focus on the PHP script itself. How would the script do it task? Think of it and the script should be implemented that way. You want to check for user input with the database? so retrieve the data, check with the database, and return the result. Nothing is complicated. MVC is MVC, AJAX is AJAX. They are 2 separate entities working together.
I'd say instead of jumping right into AJAX, you should try making yourself familier with MVC first.