Board index   FAQ   Search  
Register  Login
Board index php forum :: Database phpMyAdmin

Please help with upload text file options

How to use phpmyadmin.... phpmyadmin related arguments. Even phpMyAdmin issues

Moderators: macek, egami, gesf

Please help with upload text file options

Postby bufhal » Mon Jun 07, 2004 11:40 am

I have tried numerous combinations trying to upload the following txt file record to test via PHPMYADMIN toa MySQL databse:

101, Amherst, 12/12/2004, Blue Cross, Thurs,Rite Aid , Pharmacy, 1233 Erie Ave, 14120, 716-689-2244, Pete Wilson;

The first field is the auto increment primary key.
I have tried various options on the page for uploading a text file page--please tell me what these options should be set for.
I want to keep it as simple as possible...
Thank you :)

PHP 2.6 Mysql database
bufhal
New php-forum User
New php-forum User
 
Posts: 37
Joined: Tue May 04, 2004 5:11 pm

better explanation of my post

Postby bufhal2 » Mon Jun 07, 2004 12:28 pm

Here is the page I am referring to in PHPMYADMIN:

Fields terminated by
Fields enclosed by
Fields escaped by
Lines terminated by Carriage return: \r
Linefeed: \n
Column names If you wish to load only some of a table's columns, specify a comma separated field list.
LOAD method
...DATA
...DATA LOCAL The best method is checked by default, but you can change if it fails.
For the simple text file in my last post (which will eventually be 2-300 records), how should these settings be?
Thank you
bufhal2
 

Re: better explanation of my post

Postby swirlee » Mon Jun 07, 2004 12:45 pm

bufhal2 wrote:Fields terminated by
Fields enclosed by
Fields escaped by
Lines terminated by Carriage return: \r
Linefeed: \n


These are all fairly self-explanatory. "Fields terminated by" means "every field ends with (is terminated by)", which in your case is a comma. "Fields enclosed by" means "every field is between (enclosed by)", which in your case is nothing. Don't worry about escaping unless it becomes a problem, but if it does, the usual escape character is \. The rest should stay the same. PHPMyAdmin, by the way, has extensive documentation that answers most of these questions for you.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Guest » Mon Jun 07, 2004 12:51 pm

I have been thorugh the docs and I here what you are saying, however, only the first field (101) is successfully uploaded. I have tried several different ways. Is my text file OK in that format?
Guest
 

Postby swirlee » Mon Jun 07, 2004 1:25 pm

PHPMyAdmin assumes that the fields in your text file are in the same order as the fields in your database. If this isn't the case, you should specify the fields in the order in which they appear in the text file.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby Guest » Mon Jun 07, 2004 6:00 pm

got it going...thanks all :grin: :grin: :grin:
Guest
 


Return to phpMyAdmin

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron