PHP, SQL, and save/restore layout changes