2

I would like to execute a stored procedure, and return immediately back to the script, and the SP shall run in the background until complete, and should not be killed by the PHP process.

How can this be done in PHP?

Pentium10
  • 204,586
  • 122
  • 423
  • 502

2 Answers2

4

I believe you can make it work by using mysql events. I haven't tried personally, but it seems like what you are looking for.

a1ex07
  • 36,826
  • 12
  • 90
  • 103
2

You could trigger the execution of a separate PHP script that would run asynchronously (and execute the stored procedure~)

Asynchronous PHP

Community
  • 1
  • 1
Shad
  • 15,134
  • 2
  • 22
  • 34
  • I don't know if this is true or not, but is it considered poor practice to run the shell and execute commands directly? Honest question. – rockerest Feb 28 '11 at 08:22
  • 2
    I say, if it's something you can't do in PHP directly, why not? (my take) – Shad Feb 28 '11 at 08:25