I'm creating an internet site that will query an easy MySQL database using AJAX calls to PHP scripts.

I've investigated frameworks which accomplish this but I am searching for a lighter in weight solution and thus am rollign my very own. At the moment I've all AJAX calls striking just one script, which in turn calls further functions in line with the content of Published variables. Individuals functions return objects or throw exceptions, as well as in my primary script I either return a JSON encoded versionof the item or catch the exceptions and return a JSON encoded "error object".

Performs this approach seem ok or otherwise? Otherwise, what's best practise within this scenario?

around the serverside i'd reommend a restful approach.

but for the client side javascript i would suggest jQuery ($().ajax())

also it most likely would't hurt to code following the concepts of MVC

Avoid styling the PHP came back text, style the page within the AJAX or Javascript demands. Check if the page presently includes CSS and when not then include it.