Reputation: 618
Inside my php I have a function which creates a connection to my db, insert info and closes the connection. I want to use the same function to write into another db as well. But before I attempt to make connection the other db I need to know that the first query is executed successfully. Is there a way to make the php wait until the insert function is done? like a while loop or something?
Upvotes: 1
Views: 522
Reputation: 798526
Unless you use INSERT DELAYED
the insert is synchronous. Test the return value in order to see if the insert succeeded.
Upvotes: 2