473,487 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MySQL beginner confused!

2 New Member
Alright, I am a definate nube at mysql and I have a problem that I just cannot figure out. I am trying to integrate a CMS database 'forum' data to another CMS database forum. I pretty much have all the variable lined up, I just need to do one thing...
Alright, say I have a two table example1 and example 2
I need to migrate the data from example 2 table to example 1 table but I need to match the data up alongside the data that currently resides there. Like for instance in table example1 I have a primary key there and I just need the example2 table to group data accordingly with the primary key in example 1 table, which is an auto_increment field.
I am not really sure that I completely understand if I even explained that right, but I hope someone can just help me out a little bit here. This is my first task ever working with MySQL and I feel like I may be over my head... But there is no greater lesson than experience.
Jan 10 '08 #1
3 1279
mwasif
802 Recognized Expert Contributor
Hi ventspacey,

Welcome to TSDN!!!

You can use INSERT...SELECT syntax of MySQL. You can choose the data to INSERT in SELECT statement on any criteria you want.
Jan 10 '08 #2
ventspacey
2 New Member
okay, well let me give you an example...
table 1 includes these columns.

id, name, email

table 2 includes these columns

mesid
message

I need to somehow migrate table 2 into table 1 but I need the messages to correspond to the names...
Jan 18 '08 #3
Delerna
1,134 Recognized Expert Top Contributor
Diagrams of your data and result you want can help when asking a question of this type. For example

Table1
id, name, email
1 Ted Ted@Emailaddress
2 Ken Ken@EmailAddress

table2 -- Note mesid relates to id
mesid message
2 Hello from ken
2 Another hello from ken
1 Hello from Ted
2 A third hello from ken

Result --Note This should be a view
ID Name Email message
2 Ken Ted@Emailaddress Hello from ken
2 Ken Ted@Emailaddress Another hello from ken
2 Ken Ted@Emailaddress A third hello from ken
1 Ted Ken@EmailAddress Hello from Ted

Is something like that what you are after???

By the way, its good to do that with any problem you are struggling with.
with a bit of experience the answer can jump out at you


PS Are you in over your head? Yes, at the moment
Will you ever be able to swim?? Yes, if you never give up, never surrender
Jan 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2135
by: Daniel Tonks | last post by:
Here's the situation: I have a Perl-based forum that I wrote myself. It currently supports user accounts, but these are stored in a flat text file (as is everything else for that matter). I'm...
3
3112
by: c_chen | last post by:
Hi, i am a beginner in PHP and mySQL. Whenever I try to connect my php and mysql database, i get this error.: MySQL error : access denied for myuser@localhost (Using password:yes) I have...
4
3011
by: Sebastiaan van den Berg | last post by:
Hello, Im new to mysql... I Would like to learn from scratch. So what should i look for on the internet and what would be handy for a beginner to start with?? I'd appreciate the help. :) Thank...
2
2024
by: stephane_husser | last post by:
My company is currently investigating in several database, projects tracking software. Being a beginner, I would like to know if you could provide me some support concerning the capabilities of...
51
3717
by: w_curtis | last post by:
I'm an Access user, and I'm trying to learn MySQL and then PHP so I can make some web databases. But it just isn't clicking. I've followed some tutorials, and picked up a book, but just getting...
0
1378
by: Asad | last post by:
I just tried downloading and installing mysql plenty of time. I tried installing the "no-install" version and the other binary using setup.exe. However, in both cases I just don't seem to have a...
2
15748
by: sunny076 | last post by:
Hi, I am confused with the syntax for NOT in MYSQL where clause and wonder if an expert in MYSQL can enlighten me. There are possibly two places NOT can go in: select * from employee_data...
1
2635
by: aryan24 | last post by:
Hi, I am new to LINUX. I have down loaded MySQL-server-community-5.0.45-0.sles10.i586.rpm from the site and trying to install on suse linux 10.2. using this command #>rpm -i...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.