title: Avoid two php petitions happening at the same time
body: <p>I am developing on a prestashop website that has two js scripts that are executed at the same time, when the document is ready. Both are ajax petitions. My problem is that the user I use to connect to the database has a maximun of one connection at the same time and,as both scripts are executed at the same time, it always throws an exception.</p>
  
  <p>I was wondering if there is some way to make an script way until there are not petitions to the server. I mean, making the second script wait until the first one has finished it's job.</p>
  
  <p>It would be great if I could do this without having to change the first one, as it's a default script of Prestashop.</p>
  
  <p>Thank you beforehand :)</p>