Go Back   Tech Support Forum > Design Forum > Web Serving and Management

User Tag List

MYSQL from one table to another

This is a discussion on MYSQL from one table to another within the Web Serving and Management forums, part of the Tech Support Forum category. Hi, Not sure where to put this. I have two databases on the one server. DB1 - planesp2_aircraft table -


Closed Thread
 
Thread Tools Search this Thread
Old 07-13-2018, 08:41 AM   #1
Elite Commander
 
VividProfessional's Avatar
 
Join Date: Apr 2009
Location: Merseyside Uk
Posts: 1,406
OS: Windows 10

My System

Send a message via MSN to VividProfessional

Hi,
Not sure where to put this.
I have two databases on the one server.

DB1 - planesp2_aircraft
table - adsb_logs

DB2 - planesp2_system
table - spotting

What I need to do is to move the contents of aircraft.adsb_logs to planesp2_system.spotting.

However the aircraft.adsb_logs only has 4 fields -

id
icao
firstSeen
lastSeen

and the destination database has a LOT more fields:

id
date
uname
location
type
registration
make
model
engine
operator
eng_make
eng_model
eng_vari
eng_num
role
config
icao
modes
ff
Secal
unotes
anotes

What I have as an example of some data from the logs table is -
Code:
1 4ca683 2018-07-12 13:05:56 2018-07-12 13:11:20
so this data from this table needs to be entered as follows into the spotting table (note I am only listing the fields amended with real data the rest can be "Null" ):

id 1
date 2018-07-12
uname David
location Kirkby Radar
type Radar
registration TBC
modes 4ca683

Note that from the adsb_logs table on DB1 to the destination DB2 spotting means a few new inserts, including name, location, type and registration.
And also that the date is adjusted from 2018-07-12 13:05:56 to just "2018-07-12"

Users for each DB have access to the other.

I am guessing either a cron job or a php page from which I can kick this off manually?
__________________
Boeing 787 Dreamliner Register
The worlds premier Dreamliner site
www.b787register.co.uk
VividProfessional is offline  
Sponsored Links
Advertisement
 
Old 07-17-2018, 08:16 AM   #2
Elite Commander
 
VividProfessional's Avatar
 
Join Date: Apr 2009
Location: Merseyside Uk
Posts: 1,406
OS: Windows 10

My System

Send a message via MSN to VividProfessional

Hi all,
okay so an update, I have figured out part A. Now i need to figure out Part B:

The adsb_logs table only has 4 fields -

id
icao
firstSeen
lastSeen

and the destination database has a LOT more fields:

id
date
uname
location
type
registration
make
model
engine
operator
eng_make
eng_model
eng_vari
eng_num
role
config
icao
modes
ff
Secal
unotes
anotes

What I have as an example of some data from the logs table is -

Code:
1 4ca683 2018-07-12 13:05:56 2018-07-12 13:11:20
so this data from this table needs to be entered as follows into the spotting table (note I am only listing the fields amended with real data the rest can be "Null" ):

id 1
date 2018-07-12
uname David (Static Field)
location Kirkby Radar (Static Field)
type Radar (Static Field)
registration (takes data from ICAO field)

Note that from the adsb_logs table on DB1 to the destination DB2 spotting means a few new inserts, including name, location, type and registration.

This needs to be done by a MySQL script.
__________________
Boeing 787 Dreamliner Register
The worlds premier Dreamliner site
www.b787register.co.uk
VividProfessional is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
BSOD Error 0xF4- Wireless Card?
Hi there, Two days ago my system started getting sporadic BSOD's (all of the error code 0xF4) and now it is quite consistent. The only thing I did that day was update windows 7 with updates: KB3035583 & KB3150513. These have since been deleted. In addition and for whatever reason there was no...
Champion1 BSOD, App Crashes And Hangs 4 05-15-2016 09:01 PM
Random BSOD after leaving the pc for a while
Hi , I have BSOD problem it appears after leaving my pc for a while like ( IRQL_NOT_LESS_OR_EQUAL , MEMORY_MANAGEMENT , ATTEMPTED_WRITE_TO_READONLY_MEMORY ) ∑ OS - Windows 10, 8.1, 8, 7 or Vista? Win10 Pro ∑ x86 (32-bit) or x64 ? x64 ∑ What was the original installed OS on the system? 7 then...
MjoD_16 BSOD, App Crashes And Hangs 2 04-28-2016 01:29 AM
[SOLVED] After pressing some key combo, I boot into emergency mode
I use Fedora 20. After pressing ctrl-alt-some function key, I entered emergency mode. Now every time I boot my computer, I enter emergency mode before I enter the normal OS. When I enter the normal OS there are no problems. How do I disable the auto-boot into emergency mode?
jengelhart Linux Support 26 07-25-2014 04:12 PM
HP Compaq NC6230 chipset problem
hello, i have a problem with my HP compaq NC6230 notebook. i`m trying to fix it since a week, i`m going to describe what i actually did: 1 it did`nt want to work with the HDD (i think its got a very picky motherboard) and its always showed an error message "1782-disk controller failure" and...
Zs0lt Motherboards, Bios & CPU 7 07-18-2011 02:02 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 09:06 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts