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

Sensible Method of Inserting Records In To MySQL

P: n/a
Hello,

I'd appreciate suggestions as I hash out my idea. Perhaps I'm going about
this the wrong way.

I have users using a third party windows application. They can export data
from this application directly to a text file (CSV). So far as I know,
there is no way to make this application talk directly to the MySQL server.

We're talking thousands of records here - it's not practical to have an HTML
form handled by PHP which inserts the data to MySQL... or is it??

What I thought about doing was to have them export the data to the CSV file
& then upload it to the web server using FTP. Once uploaded, I would have
them go to a page with a PHP script which would run the command to import
the data to MySQL. PHP can run shell commands, as I understand it from the
manual. Perhaps this would be a bitch on Windows, though.

Is this sensible? Suicide? Brilliant? Stoopid?

What would be the best method of tackling this issue?

FWIW, the site runs Apache on Windows 2000 w/ PHP4 / MySQL 4.

Thanks.


Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

On 11-Aug-2003, "Frank Pryor" <ne**@groups.only> wrote:
I'd appreciate suggestions as I hash out my idea. Perhaps I'm going about
this the wrong way.

I have users using a third party windows application. They can export
data
from this application directly to a text file (CSV). So far as I know,
there is no way to make this application talk directly to the MySQL
server.

We're talking thousands of records here - it's not practical to have an
HTML
form handled by PHP which inserts the data to MySQL... or is it??

What I thought about doing was to have them export the data to the CSV
file
& then upload it to the web server using FTP. Once uploaded, I would have
them go to a page with a PHP script which would run the command to import
the data to MySQL. PHP can run shell commands, as I understand it from
the
manual. Perhaps this would be a bitch on Windows, though.

Is this sensible? Suicide? Brilliant? Stoopid?

What would be the best method of tackling this issue?

FWIW, the site runs Apache on Windows 2000 w/ PHP4 / MySQL 4.


You might look at how phpMyAdmin handles this. They allow you upload the CSV
file and insert the records all from one page. The only problem I know of is
having the page timeout because of the large number of records.

--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #2

P: n/a
On Mon, 11 Aug 2003 20:16:40 -0400, "Frank Pryor" <ne**@groups.only>
wrote:
Hello,

I'd appreciate suggestions as I hash out my idea. Perhaps I'm going about
this the wrong way.

I have users using a third party windows application. They can export data
from this application directly to a text file (CSV). So far as I know,
there is no way to make this application talk directly to the MySQL server.
I've never tried it, but you should be able to use an ODBC driver.
What I thought about doing was to have them export the data to the CSV file
& then upload it to the web server using FTP. Once uploaded, I would have
them go to a page with a PHP script which would run the command to import
the data to MySQL. PHP can run shell commands, as I understand it from the
manual. Perhaps this would be a bitch on Windows, though.
PHP needn't be run by a web server. You can run a PHP script from the
command line. If your program FTP'd the files into an upload
directory, you could write a script that checks this dir and processes
all the files therein. Schedule this script to run however often you
need it to.
Is this sensible? Suicide? Brilliant? Stoopid?

What would be the best method of tackling this issue?


I'd try and get the app to talk directly to the database. Then you can
provide better feedback if things go wrong, and there's less to go
wrong in the first place.

Good Luck!

--
David (please modify address to david@ before replying!)
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.