astromax — 2009-10-09T20:53:42-04:00 — #1
Good Day Everybody,
I'm am designing online store. My supplier is giving product information (images, product description, prices etc) in .txt file. The list is more than 9,000 long.
How can I convert this information into MySQL and retrieve data whenever user clicks product for purchase, since my online store will be a dynamic site.
I need to update the list almost daily as inventory from the supplier changes often.
I need distinguished forum members' advice on this very basic question.
NOTE: I'm new to site design and development and Sitepoint's books have been really helpful in guiding me thus far.
force — 2009-10-10T00:43:28-04:00 — #2
Something like this, maybe?
astromax — 2009-10-10T19:55:04-04:00 — #3
Thank you very much for the link. I appreciate your help.
freezea — 2009-10-12T12:38:05-04:00 — #4
A couple of things you can look at:
PHP has a function called fgetcsv for importing CSV files, so you may be able to use that:
Alternatively, look into the mysql LOAD_DATA function:
webcosmo — 2009-10-12T12:56:07-04:00 — #5
Sounds like you have to update inventory feed from vendors daily.
Best approach is having a module that takes the data feed in text/csv or other possible formats and process it. Check out the file readers functions.
And be sure not to process all data at once. Add some sort of interval using threading. Otherwise you might overload the database if there is too much data.
astromax — 2009-10-13T02:05:15-04:00 — #6
Thank you to Freezea and Webcosmo for your pointers. It was very helpful.
mittineague — 2014-09-23T23:22:06-04:00 — #7
This topic is now archived. It is frozen and cannot be changed in any way.