Page 1 of 1

Communication between PHP scripts. How?

Posted: Mon Mar 09, 2009 6:49 am
by username123
hi guys

i need help here as im really new to php and mysql.

lets say i have a
- database,
- one php script updating this database at certain moments of time. i wanted to run this script from command line for an infinite period of time so it would behave sort of like a server.
- another php script used to communicate with the user. this script is supposed to retrieve data from database and maybe requesting an update of certain rows in it.

now to the question
when the 'server' is doing its calculations and updating the database i want the other script (the one communicating with user) to wait with certain reads until 'server' has finished its job.
1) How do i do that?
2) How could those 2 scripts communicate?

i know i could lock certain rows in the database until 'server' has finished with them but what are the other options here?
how about setting some flags or creating an array with identifiers of rows being currently updated?
How could those scripts share these data.

tnx