From: "Gronquist, Jim M" <[EMAIL PROTECTED]> > I've set up dev and prod webservers. Users can go into the dev webserver > content and edit it. The content is in a mysql database. I have a button > on the webpage that says push content live. When the button is pushed I > want it to run a php script that will copy the dev mysql table data into > the prod mysql table.
Are these physically separete web servers? Is there any reason you couldn't just use a "status" column in one database to mark whether something is "dev" or "live" ? If not, how about using a status column in the "dev" server that keeps track of what's been pushed? Then you could use a INSERT INTO ... SELECT ... statement to copy everything that's "unpushed" to the "live" server, and then update the status column. INSERT INTO liveserver.tablename SELECT * FROM devserver.tablename WHERE pushed_column = 'unpushed'; UPDATE devserver.tablename SET pushed_column = 'pushed' WHERE pushed_column = 'unpushed'; Wrap those in a transaction or LOCKs so you don't end up missing anything and it should work as long as both tables are the same. Even if they are different, you can format your INSERT ... SELECT query accordingly. Or, if you delete things from the "dev" table after they've been "pushed", then just use a DELETE query instead of an UPDATE query for the second one. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php