Need help with upload to MySQL table
I need someone who can write a script for uploading a datato a MySQL table.
Here's the quick rundown. I have a comma delimited text file that I want to load into a MySQL table. The MyPHPAdmin section of the control panel has this functionality. There's a page where you specify your text file along with several other parameters and it uploads the file and then loads it into the specified table. This was working fine and then stopped working for no appearent reason.
Web servers are provided with open source and third party applications thru a universal network and programs like PHP, MySQL, cPanel are often updated, upgraded, etc. I have been told this may be why my upload quit working.
These are the error msg's generated:
Error 1
SQL-query :
LOAD DATA LOCAL INFILE '/tmp/php0exjIb' INTO TABLE `tblAssessments` FIELDS
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'
MySQL said:
#1148 - The used command is not allowed with this MySQL version
Error 2
SQL-query :
LOAD DATA INFILE '/tmp/phpKVLZP2' INTO TABLE `tblAssessments` FIELDS
TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
MySQL said:
#1045 - Access denied for user: 'weight@localhost' (Using password: YES)
The difference is selecting DATA or DATA LOCAL for the LOAD command.
In trying to get this working again, my programmer decided to build an upload page manually. Problem is he ran into the same "Access denied" error as in the second case.
Here is one approach my programmer has tried:
He built a simple page to browse for a file on the local pc. The file is selected (csv) for upload. The first step is to upload the file to a
directory on the serve. The directory is wide open to write files to
(CHMOD 755). After the file is uploaded He tries to LOAD it into my database table. This is where he gets the access denied message.
The message boards talk about this problem and how to do the upload but the catch is that the commands/functions that it calls for are for PHP 5. My PHP ver is 4.
I am not a programmer myself, but can supply the necessary server information and a test csv file to get this working.
Please let me know how much work would be involved, the timing and cost.
Much appreciated.
William