WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-09-2006, 02:19 PM
kgun's Avatar
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 5,071
kgun RepRank 3kgun RepRank 3
Default MySql and phpMyAdmin importing code from .txt file

Do I need to read or can somebody help me in a hurry. I have no experience with phpMyAdmin. It seems like a great tool, where you can get an overview of databases, how to generate a new database and new tables etc.

Problem:
How to import a new table into an empty database from a text .txt (ANSI coding) file?
Reply With Quote
  #2 (permalink)  
Old 10-09-2006, 08:38 PM
sands's Avatar
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default

Do not know about phpMyAdmin, but if you want to do it with simple code check out:
http://www.modwest.com/help/kb6-253.html
and for more detailed reading:
http://www.unixreview.com/documents/s=8472/ur0307c/

The former worked perfectly well for me for .php and .txt files where the data was originally in flat-file database.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #3 (permalink)  
Old 10-10-2006, 08:02 AM
kgun's Avatar
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 5,071
kgun RepRank 3kgun RepRank 3
Default

Very easy in phpMyAdmin that comes with XAMPP

I was close to do it yesterday, but did not browse and import the file. The documentation is excellent.

Here is the way to do it for persons that like to read first, like me:

1. At the phpMyAdmin home page click "FAQ" on the top menu.

2. While on the FAQ menu click "Usage tips."

The point 6.5 (in my version of the admin toolkit) says:

How can I restore (upload) my database or table using a dump? How can I run a ".sql" file?

Click on a database name in the left frame, the properties will be displayed. Select "Import" from the list of tabs in the right–hand frame (or "SQL" if your phpMyAdmin version is older than 2.7.0). In the "Location of the text file" section, type in the path to your dump filename, or use the Browse button. Then click Go.

With version 2.7.0, the import engine has been re–written, if possible it is suggested that you upgrade to take advantage of the new features.

For additional help on this subject, look for the word "upload" in this document.

-------------------------------------------------------------------------

Done in a second.

A .sql file is a plain txt file.

Nevertheless, thank you for your advice.
Reply With Quote
  #4 (permalink)  
Old 10-10-2006, 08:51 AM
sands's Avatar
WebProWorld Veteran
 

Join Date: Sep 2005
Location: Kerala, India
Posts: 397
sands RepRank 1
Default

Quote:
Originally Posted by kgun
Done in a second.

A .sql file is a plain txt file.

Nevertheless, thank you for your advice.
Glad to help. Never did take a look at phpMyAdmin. Also for me the problem was that I needed a part of the same data in the flat-file to be included in another MySQL table as well. This would not be possible with phpMyAdmin. But with that code I could modify it according to my needs.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #5 (permalink)  
Old 10-10-2006, 08:58 AM
kgun's Avatar
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 5,071
kgun RepRank 3kgun RepRank 3
Default

May be good to know that in the future.

Do you know what is possible in the latest versions, phpMyAdmin 2.9.0.2 is released ?

I have an older version, 2.8.0.3 of phpMyAdmin.

Thanks again.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: , , , , ,



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0