0

when i send many msgs at at time in background my websites is stuck until my request is complete . I am sneding msgs using php in background. How to get rid of this if request is in process mode we can easily access the websites ..??

  • Welcome to Stack Overflow! This question lacks any code to show us that you've made any attempt to solve this yourself. If you've tried something, show us what you've tried, example of the expected output and what you're actually getting. If you haven't tried anything, you need to do that before posting. We can help you with your existing code, but we won't write it for you. Please read: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and also [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask). – Jomoos Feb 19 '18 at 11:17
  • Also read: [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/q/261592/851432) Currently, this question is way too broad and unspecific. – Jomoos Feb 19 '18 at 11:17
  • That doesn't sound like a background process to me... – Jonnix Feb 19 '18 at 11:23
  • for($i=0;$i<50000;$i++){ $currentDaye=date("H:i:s",strtotime("now")); $sqlInsert="INSERT INTO testTable SET entry_date='$currentDaye'"; try { $STH = $conn->prepare($sqlInsert); $STH->execute(); } catch(PDOException $e) { } } – Ravindra Yadav Feb 19 '18 at 11:35
  • the above code will tell u my problem i am trying to insert time 50000 in table my browser is stuck until the loop is in process i cant access any option of my websites in same browser bt i can easily access it if i go from another browser at the same time. If there is any way to solve it . the above code will tell u my problem i am trying to insert time 50000 in table my browser is stuck until the loop is in process i cant access any option of my websites in same browser bt i can easily access it if i go from another browser at the same time. If there is any way to solve it . – Ravindra Yadav Feb 19 '18 at 11:36
  • I would suggest to run the code async like here: https://stackoverflow.com/questions/5905877/how-to-run-the-php-code-asynchronous – Marvin Klar Feb 19 '18 at 11:50

0 Answers0