When I use ajax, I have to use mysql_query again to get information in that file which is for ajax. Can I do action without mysql_query like with include();?
Ask if you don’t understand, because I guess I asked not very properly.
edited: When I try to reach ajax file, in that file I have to retrieve member information again. So, my question is, is it possible to avoid that?
Use a combination of content negotiation and caching, e.g
Like Ignacio explained, each requests to the server is isolated. PHP has a shared nothing architecture, so the only thing you can do to prevent the query from running again is to cache it. Content negotiation just helps to use the same query and return it on the depending request context, so you dont have a Controller Action for Ajax and one for regular calls.