By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,190 Members | 1,412 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,190 IT Pros & Developers. It's quick & easy.

Populating MySQL table with text file using myPHPadmin

P: n/a
Greetings.

I'm somewhat new to this whole MySQL/PHP thing and need a little help.

My web hosting service uses phpMyAdmin and at the bottom of the screen
iis an area where I can upload a text file to populate a table.

I have a table named groups with two fields:
groups_id auto-increment primary
groups_name

So how do I create my text file to populate this table?

I'm going to use MS Notepad.

If it's set to auto-increment, do I need to include the number? If
so, does it start at 0 (zero)?

Would the file look like:

0,students
1,faculty
2, staff

or just

students
faculty
staff

(though I can't image that working).

Any help is appreciated.

Thanks.

Ward
Aug 6 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The format of that file must be in the same format as is written out by the
EXPORT function. Put some data into a table, do an export, then see what it
looks like.

The idea behind this is so that you can export data from one database and
import into another using the same file. I do it all the time. so I know it
works.

--
Tony Marston

http://www.tonymarston.net

"Ward B" <Wa*******@hotmail.com> wrote in message
news:79********************************@4ax.com...
Greetings.

I'm somewhat new to this whole MySQL/PHP thing and need a little help.

My web hosting service uses phpMyAdmin and at the bottom of the screen
iis an area where I can upload a text file to populate a table.

I have a table named groups with two fields:
groups_id auto-increment primary
groups_name

So how do I create my text file to populate this table?

I'm going to use MS Notepad.

If it's set to auto-increment, do I need to include the number? If
so, does it start at 0 (zero)?

Would the file look like:

0,students
1,faculty
2, staff

or just

students
faculty
staff

(though I can't image that working).

Any help is appreciated.

Thanks.

Ward

Aug 7 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.