|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL or CSV?
Hi,
I've been asked to write a web front-end point-of-sale system for a company, that will take it's data (products, prices, stock levels etc) from a set of CSV files which will be produced by a back-end accounts package at regular intervals (say, every half an hour). I am fairly confident writing SQL driven websites, and have worked with CSV files in a very limited way in the past, but I am unsure of how I should work this. Is there any way I can regually import/export the data in the CSV files to/from a mySQL database, and then set up the web pages to query that, or should I just find a way to do the whole thing using the original CSV files? If I use the CSV files won't I run into all sorts of problems re locking etc? Is it even possible to use the CSV files as the database? - there will be a lot of transactions, and I will need to be keeping track of stock levels across many stores, and from what I've always been lead to believe CSV probably isn't up to the job. Any advice would be greatly appriciated. Many thanks Jack |
|
#2
|
||||
|
||||
|
write a cron to take the csv files and use mysqlimport to load them into your DB. the InnoDB engine would probably be your best bet so you can do the imports in a transaction.
__________________
life is a game.... Have fun ----------------------------- http://www.phpwomen.org strength in unity PHPCommunity IRC #phpc on freenode |
|
#3
|
|||
|
|||
|
Thanks for your reply Liq. I had always wondered what cron jobs were- solves a lot of problems. I don't fully understand the second part though - how will InnoDB help me?
Again, thanks for your reply. Jack |
|
#4
|
||||
|
||||
|
cron jobs are scripts that run on a predefined schedule - once a minute, every 20 minutes, once a day every 3rd day and so on.
and InnoDB will help you by making the import part of a singular transaction so if there are any problems you can handle it and rerun the import. all to maintain your data integrity. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > SQL or CSV? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|