LOAD DATA INFILE issues

Hello I write with hope to find a fix for my issue.

My issue is that I have a hosting company that it appears will not put FILE Priv on my database.

What other type of ways could I upload a very large fixed-width file so using a array is proberly not going to be a good thing.

What other options do I have so I can do this automated data uploader.

If someone has a sample of how to do this I would greatly be thankful I wan t to be able to move on with this project. THIS progject is for a non-profit org

Sincerely,
Christopher

From what I can tell you’re trying to upload a file towards your host using PHP. And you’re not allowed to store this file in a directory on your server?

Ok, I been playing around and if I do this in phpMyAdmin then I get this:

SQL query:

LOAD DATA LOCAL INFILE '/home80c/sub003/sc44514-NPGU/uploads/EOA01.LST' INTO TABLE IRS_EOML(
@var1
) SET col0 = substr( @var1 , 0, 9 ) ,
col1 = substr( @var1 , 9, 70 ) ,
col2 = substr( @var1 , 79, 35 ) ,
col3 = substr( @var1 , 114, 35 ) ,
col4 = substr( @var1 , 149, 22 ) ,
col5 = substr( @var1 , 171, 2 ) ,
col6 = substr( @var1 , 173, 10 ) ,
col7 = substr( @var1 , 183, 4 ) ,
col8 = substr( @var1 , 187, 2 ) ,
col9 = substr( @var1 , 189, 1 ) ,
col10 = substr( @var1 , 190, 4 ) ,
col11 = substr( @var1 , 194, 6 ) ,
col12 = substr( @var1 , 200, 1 ) ,
col13 = substr( @var1 , 201, 2 ) ,
col14 = substr( @var1 , 203, 9 ) ,
col15 = substr( @var1 , 212, 1 ) ,
col16 = substr( @var1 , 213, 2 ) ,
col17 = substr( @var1 , 215, 6 ) ,
col18 = substr( @var1 , 221, 6 ) ,
col19 = substr( @var1 , 227, 1 ) ,
col20 = substr( @var1 , 228, 1 ) ,
col21 = substr( @var1 , 229, 3 ) ,
col22 = substr( @var1 , 232, 3 ) ,
col23 = substr( @var1 , 235, 2 ) ,
col24 = substr( @var1 , 237, 13 ) ,
col25 = substr( @var1 , 250, 13 ) ,
col26 = substr( @var1 , 263, 1 ) ,
col27 = substr( @var1 , 264, 13 ) ,
col28 = substr( @var1 , 277, 1 ) ,
col29 = substr( @var1 , 278, 4 ) ,
col30 = substr( @var1 , 282, 35 ) ,
col31 = substr( @var1 , 317, 1 )

MySQL said: Documentation
#1054 - Unknown column 'col0' in 'field list' 

any help with this would be great.

Sincerely,
christopher

Ok, I figured out why it would give the error I was geting before and that was the coloms names did not match my database table col names. Now I got that fixed, I am told that my file does not exist and it does any idea why this would happen, the folder is chmod 777?

Thanks

 Error

SQL query:

LOAD DATA LOCAL INFILE '/uploads/EOA01.LST' INTO TABLE IRS_EOML(
@var1
) SET EIN = substr( @var1 , 0, 9 ) ,
PNO = substr( @var1 , 9, 70 ) ,
ICN = substr( @var1 , 79, 35 ) ,
Street_Address = substr( @var1 , 114, 35 ) ,
City = substr( @var1 , 149, 22 ) ,
State = substr( @var1 , 171, 2 ) ,
Postal_Code = substr( @var1 , 173, 10 ) ,
GEN = substr( @var1 , 183, 4 ) ,
Subsection_Code = substr( @var1 , 187, 2 ) ,
Affiliation_Code = substr( @var1 , 189, 1 ) ,
Classification_Code = substr( @var1 , 190, 4 ) ,
Ruling_Date = substr( @var1 , 194, 6 ) ,
Deductibility_Code = substr( @var1 , 200, 1 ) ,
Foundation_Code = substr( @var1 , 201, 2 ) ,
Activity_Code = substr( @var1 , 203, 9 ) ,
Organization_Code = substr( @var1 , 212, 1 ) ,
UL_Code = substr( @var1 , 213, 2 ) ,
AFED = substr( @var1 , 215, 6 ) ,
Tax_Period = substr( @var1 , 221, 6 ) ,
Asset_Code = substr( @var1 , 227, 1 ) ,
Income_Code = substr( @var1 , 228, 1 ) ,
FR_Code = substr( @var1 , 229, 3 ) ,
Blanks = substr( @var1 , 232, 3 ) ,
Accounting_Period = substr( @var1 , 235, 2 ) ,
Asset_Amount = substr( @var1 , 237, 13 ) ,
Income_Amount = substr( @var1 , 250, 13 ) ,
IIANCNS_1 = substr( @var1 , 263, 1 ) ,
F_990_RA = substr( @var1 , 264, 13 ) ,
IIANCNS_2 = substr( @var1 , 277, 1 ) ,
NTEE_Code = substr( @var1 , 278, 4 ) ,
SN_SNL = substr( @var1 , 282, 35 ) ,
Line_Feed = substr( @var1 , 317, 1 )

MySQL said: Documentation
#2 - File '/uploads/EOA01.LST' not found (Errcode: 2) 

First query:

LOAD DATA LOCAL INFILE '/home80c/sub003/sc44514-NPGU/uploads/EOA01.LST' INTO TABLE IRS_EOML(

Second query:

LOAD DATA LOCAL INFILE '/uploads/EOA01.LST' INTO TABLE IRS_EOML(

Spot the differences :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service