pepsi_max2k Posted April 20, 2009 Share Posted April 20, 2009 Hey all, I'm new to database useage and wondering what type I should be using to store some data. I'm grabbing the data via php, so will be writing it via php, and reading it and outputting it with php too. I'm trying to keep a record of prices of some items, and want to include for each item: EAN (like UPC), product name, genre, maybe a few other things Date (probably weekly), price (for that week). date, price date, price etc etc. As well as writing data to these entries automatically, I want to be able to read all entries and output data in an organised format. Eg. One web page could show a list of all product names, ordered alphabetically, and showing the latest price. Clicking on a link for one product could show all data for that product. Any ideas what the best way to store the data would be? MySQL seems a bit complicated. CSV files are simple but would I have a single csv file for each product, or just one ever growing file with all products in it? And if I had multiple product csv files in a single directory, what would be the best way to name each file (by ean? 0001?), and would it be simple to go through all files printing out stuff as above (eg. just product name and a price)? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/154906-advice-on-suitable-database-use/ Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 Go with database. You will need to learn more at first, but it will pay off later. Storing data in txt files can work for small data sets, but forget about data analysis, reports, etc... And with growing number of items it will become unwieldy very fast. Quote Link to comment https://forums.phpfreaks.com/topic/154906-advice-on-suitable-database-use/#findComment-814776 Share on other sites More sharing options...
pepsi_max2k Posted April 20, 2009 Author Share Posted April 20, 2009 Thanks, I just read up on some simple MySQL database coding and it seems ok. I'm just worried about the constant adding of new dates and prices to each record. Is there a certain way of doing that? Right now I've just seen info on creating a set number of fields at the start, then adding single entries to each field. Quote Link to comment https://forums.phpfreaks.com/topic/154906-advice-on-suitable-database-use/#findComment-815001 Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 With properly structured database that's all you need. Here are some great resources (don't miss the first one!) http://www.phpfreaks.com/forums/index.php/topic,126097.0.html Quote Link to comment https://forums.phpfreaks.com/topic/154906-advice-on-suitable-database-use/#findComment-815004 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.