Jump to content

Recommended Posts

Hey, simple question here (I think):

 

I'm experimenting with jquery ajax to perform sql queries through php for a little game. I need these to be fast, and it's executing quite a few queries. Having said that, is it faster to send all the data to one file to perform all of these queries, or instead have mutliple php files all performing their own unique query. The benefit I can see in the latter option is that the queries would be asynchronous; however, it would require more connections to php files.

 

Any feedback would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/241233-multiple-sql-queries/
Share on other sites

It'll be easier on your server to build up a few seconds worth of queries and execute them within a single mysql connection.

 

You'll lose out on responsiveness though.

 

Your best bet is to code it so you have the option to poll up a few queries. Have it so if you set the time to 0, it executes them immediately, otherwise it waits x seconds to allow queries to build up.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.