Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2007-10-24, 02:04 PM
Junior Member
 
Join Date: Oct 2007
Posts: 3
AOVKSA is on a distinguished road
Default Mysql copying

hey all,
ok this is my situation

Inside my database: myp_smooth i have the tables of 2 scripts.

Script ones user system is: table name: USERS, with the fields: USER_NAME, USER_ID and PASSWORD

Script two is: Table name: USER with the fields: USERNAME, USERID and PASSWORD

Now
I want to copy the data from USERS (user_name,user_id,password) and dump it to: USER (username,userid,password)

Because my mysql knowledge is limited i dont know how to insert data from a table with different variables then the other.

Helps would be highly appreciated

thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2007-10-25, 12:27 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Its a manual process.....select from one, insert into the other.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2007-10-25, 11:09 AM
Junior Member
 
Join Date: Oct 2007
Posts: 3
AOVKSA is on a distinguished road
Default

ther are 20,000+ members ... im sure theres some sort of php code or syntax that can do this for me
Reply With Quote
  #4 (permalink)  
Old 2007-10-25, 11:40 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Not without mapping. A computer can't just know what fields go where unless they were named exactly the same, and even then the field type should be the same as well.

Either way, you have to map the fields one to another, it is the only way. I know TOAD for MySQL has a mapping utility in it, but I have never used that feature, and I havent used TOAD for MySQL either.

This should be VERY easy, just select, return into a while loop, and insert. If you wanted to be very creative, you could use an array to map the fields.

As to having 20K+ users, while that is true, there are not that many active, and I personally have about 15% of the posts, with Stu coming in with another 8% or so. So 2 users, out of the 20K have almost a quarter of the total posts. Most of those users ask a question or two and then never come back. Only a couple of us stick around.

If you try to code this and run into a problem, give a holler.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #5 (permalink)  
Old 2007-10-25, 07:22 PM
Junior Member
 
Join Date: Oct 2007
Posts: 3
AOVKSA is on a distinguished road
Default

My 20k+ users was to make a statement. Though i fully understand your comment regarding user activity. I'm going to research on mapping and see what I can come up with. Thanks, God bless people like you and Stu.
Reply With Quote
  #6 (permalink)  
Old 2007-10-31, 05:10 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Did you ever get a solution?
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:34 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.