AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Copying MySQL query (https://forums.alliedmods.net/showthread.php?t=223591)

Sutar 08-15-2013 08:47

Copying MySQL query
 
Hello, how to copy information from one database to another?
for example

There are two databases
1. db_one
2. db_two

The database db_one there's information it must be "Copy" in the db_two
but so that was auto_increment

for example copy
Code:

1. db_one - (id - auto_increment)
id|player|playerip
1|Player 1|127.0.0.1
2|Player 2|127.0.0.2
3|Player 3|127.0.0.3
4|Player 4|127.0.0.4
5|Player 5|127.0.0.5

Code:

2. db_two - (id - auto_increment)
id|player|playerip

You need to copy Player 3 in the db_two
After copying is obtained

Code:

1. db_one - (id - auto_increment)
id|player|playerip
1|Player 1|127.0.0.1
2|Player 2|127.0.0.2
3|Player 3|127.0.0.3
4|Player 4|127.0.0.4
5|Player 5|127.0.0.5

Code:

2. db_two - (id - auto_increment)
id|player|playerip
1|Player 3|127.0.0.3

how to do so?

fysiks 08-15-2013 21:21

Re: Copying MySQL query
 
Get the information from database 1 and put it on database 2 . . . I don't see what the issue is.

If you are trying to do this as a 'one time thing' then you shouldn't be using a plugin and should instead use something more appropriate (like all the other tools out there for databases).

Sutar 08-16-2013 06:55

Re: Copying MySQL query
 
for examples the table is small
but in reality it is 10 to 15 fields in table 2
suddenly thought is a function of a simple copy


All times are GMT -4. The time now is 15:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.