
02-28-2008, 11:28 AM
|
| |
Re: Is there a quick way to copy database information? nino9stars@yahoo.com wrote:
> Hello,
>
> I have tried searching for this subject, but can never seem to find
> exactly what I'm looking for. Here is the situation I have at hand.
>
> I want to find a quick (hopefully painless) way to copy information
> that I have stored in the database. Here is how the information is
> stored:
>
> TABLE: LeagueInfo
> league_id auto_increment primary key
> league_name, etc...
>
> TABLE: Teams
> team_id auto_increment primary key,
> teams_league_id (ties to LeagueInfo's league_id)
> team_name, etc...
>
> TABLE: Players
> players_id auto_increment primary key
> players_team_id (ties to Teams' team_id)
> players_name, etc...
>
> TABLE: Stats
> stats_id auto_increment primary key
> stats_player_id (ties to Players' player_id)
> stats_game_id, etc
>
> Since a lot of the information provided is tied to each other, how can
> I ensure that when I "duplicate" the entire league, all the
> appropriate ties stay consistent, and all the new copied information
> will have the appropriate new auto_incremented fields. For example:
>
> If I have a league called Football League with 2 teams (Team1 and
> Team2), and they have 5 players each with varying rows of stats for
> each player, how can I ensure that the new league (let's call it
> Basketball League) will easily duplicate all the information.
>
> The reason I'm doing this is because the program I'm running has the
> same teams and people join different leagues. All the team and player
> information stays the same, but they might join another sports league.
> The problem I found is that each team might change their information
> JUST SLIGHTLY from league to league. Thus, if the information is
> copied over, the manager can easily go in and just make those several
> slight changes as opposed to having to go through the entire lengthy
> process of entering their team information with each session and each
> league.
>
> Hope you all can help and I hope I made some sense. Let me know if
> there is anything I failed to mention or if something doesn't entirely
> make sense.
>
> Thanks,
> Nino Skilj
Just dump the tables and load them into the new DB |