Re: [PHP] MySQL vs. basic text file
ok - thanks for all the replies. it looks like there are no real drawbacks and plently of advantages in using MySQL instead of text files, so i'll do the next project with it. one more question - is there a concrete file that has the database in mySQL? like a file that I could download and view that contains the entire spreadsheet that i have created? On Mon, 23 Sep 2002, John S. Huggins wrote: > > I was doing this too with good old AWK CGI scripts and text data files. > Once I imported the data into MySQL I said, "Well this is not much > benefit." Then I started sorting. Then I accessed the information from a > different application. Then I wrote a maintenance application so my > customer could sort, review and edit the data. Then I started using > multitable queries. I am now so hooked on the database method, I have > never looked back. > > Keep up with your text data. You will always be able to import it into > MySQL when you are ready. I would do ahead and migrate to a database; You > will have a slight learning curve, but will reap many benefits. > > John > > On Sat, 21 Sep 2002, Doug Parker wrote: > > >-often i use text files at my data sources, delimted by the "|" symbol. > >-i simply delimit the fields of each line, then when i need to open them, > >-i open the text file, populate an array with each line, then explode the > >-fields for each to get the corresponding values. i use this method for > >-catalogs - and even backend interfaces, for which the client can > >-add/edit/delete products. everything seems to be working fine, and > >-there doesn't seem to be a need for MySQL or anything. i was wondering > >-if there is anything i'm not thinking of that perhaps would push me to > >-favor using php and mysql instead of the plain old text file. > >- > >- > >- > >--- > >-PHP General Mailing List (http://www.php.net/) > >-To unsubscribe, visit: http://www.php.net/unsub.php > >- > > ** > > John Huggins > VANet > > [EMAIL PROTECTED] > http://www.va.net/ > > ** > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs. basic text file
Hi Doug, on 22/09/02 9:25 AM, Doug Parker ([EMAIL PROTECTED]) wrote: > often i use text files at my data sources, delimted by the "|" symbol. > i simply delimit the fields of each line, then when i need to open them, > i open the text file, populate an array with each line, then explode the > fields for each to get the corresponding values. i use this method for > catalogs - and even backend interfaces, for which the client can > add/edit/delete products. everything seems to be working fine, and > there doesn't seem to be a need for MySQL or anything. i was wondering > if there is anything i'm not thinking of that perhaps would push me to > favor using php and mysql instead of the plain old text file. If it aint broke, don't fix it I guess, but I'd argue a few points: - at some point, your data will get too large, and the file method will get sluggish. this is where MySQL differs, because you can index columns, have full text indexes for search engines, etc etc to increase performance and features. - simple things like auto-incrementing row numbers - i find updating / editing data MUCH easier in a database than I do in a CSV... - i find complicated queries MUCH easier in a MySQL database. I guess the answer is that you COULD provide functionality for all of this by writing some functions, but my question is WHY, when MySQL is likely to be 1 or 100 or 1000 steps in front of you at all times. What I *DO* find useful is to let some of my customers edit or export their data in CSV format, which I use to munch into a set of MySQL tables... It gives them very cheap, hands-on editing of the data, but still gives me a quick/flexible back-end. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL vs. basic text file
Speed Accessability Features Security Performance Simplicity Reusability Indexing Record-Locking To name a few. however, in your situation, it's an existing application which is working great and which no one has any complaints over. If it ain't broke, don't fix it. For your next application, use a database. When it's time for a major upgrade to this one, convert, until then, just leave things the way they are. Let me illustrate a point on the performance/simplicity front. let's say that you need to change the title of an item in a catalog. With a text file: 1.) Open the file 2.) Read the contents of the file until you find the item you're looking for (got help us if it's the last item!) 3.) Parse the line 4.) rewrite the line with the new information 5.) rewrite the file 6.) Close the file ellapsed time: depending on the speed of the computer, typically between 1-5 seconds With a database 1.) Open the database 2.) UPDATE catalog SET title='new title' WHERE item=123 ellapsed time: < 1 second, my benchmarks show usually in the .26-.33 second range -Original Message- From: Doug Parker [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 4:26 PM To: [EMAIL PROTECTED] Subject: [PHP] MySQL vs. basic text file often i use text files at my data sources, delimted by the "|" symbol. i simply delimit the fields of each line, then when i need to open them, i open the text file, populate an array with each line, then explode the fields for each to get the corresponding values. i use this method for catalogs - and even backend interfaces, for which the client can add/edit/delete products. everything seems to be working fine, and there doesn't seem to be a need for MySQL or anything. i was wondering if there is anything i'm not thinking of that perhaps would push me to favor using php and mysql instead of the plain old text file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs. basic text file
I was doing this too with good old AWK CGI scripts and text data files. Once I imported the data into MySQL I said, "Well this is not much benefit." Then I started sorting. Then I accessed the information from a different application. Then I wrote a maintenance application so my customer could sort, review and edit the data. Then I started using multitable queries. I am now so hooked on the database method, I have never looked back. Keep up with your text data. You will always be able to import it into MySQL when you are ready. I would do ahead and migrate to a database; You will have a slight learning curve, but will reap many benefits. John On Sat, 21 Sep 2002, Doug Parker wrote: >-often i use text files at my data sources, delimted by the "|" symbol. >-i simply delimit the fields of each line, then when i need to open them, >-i open the text file, populate an array with each line, then explode the >-fields for each to get the corresponding values. i use this method for >-catalogs - and even backend interfaces, for which the client can >-add/edit/delete products. everything seems to be working fine, and >-there doesn't seem to be a need for MySQL or anything. i was wondering >-if there is anything i'm not thinking of that perhaps would push me to >-favor using php and mysql instead of the plain old text file. >- >- >- >--- >-PHP General Mailing List (http://www.php.net/) >-To unsubscribe, visit: http://www.php.net/unsub.php >- ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL vs. basic text file
"Doug Parker" <[EMAIL PROTECTED]> wrote: > i was wondering > if there is anything i'm not thinking of that perhaps would push me to > favor using php and mysql instead of the plain old text file. It sounds like you're basically asking why one would want to use a relational database. Standardization, speed and flexibility for starters. MySQL and many other databases use the SQL language for accessing db data. If your dataset is large a SQL statement to return records from indexed tables will be much faster than code at the application level. And a relational database allows you to store data in separate logical tables instead of one large table - for example tables of products, inventory, customers and orders. Using SQL to query these tables to find out something like the quantity and total revenue of widgets sold in August to customers in New Jersey whose company name begins with R would be much easier with a relational database than 1 or more text file datasets. There are many other benefits, though that's not to say that text files aren't sufficient for your current needs. I recommend reading about relational database online or in a book and playing with one of the more popular open source databases such as MySQL or PostgreSQL. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL vs. basic text file
Well, one major advantage I have found using MySQL verses txt files is the simple implementation of transactions, if you are doing multiple transactions that are related, it is nice to simply "rollback" all other statements if one fails or "commit" if they work. Of course you can do this other ways but the simplicity is nice. Although I am still a newbie, I would also have to say there would be a speed issue, if you only wan't one row returned versus reading enire file into memory then walking through it one at a time, mysql's indexing can greatly speed this process up. HTH, Steve. -Original Message- From: Doug Parker [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 7:26 PM To: [EMAIL PROTECTED] Subject: [PHP] MySQL vs. basic text file often i use text files at my data sources, delimted by the "|" symbol. i simply delimit the fields of each line, then when i need to open them, i open the text file, populate an array with each line, then explode the fields for each to get the corresponding values. i use this method for catalogs - and even backend interfaces, for which the client can add/edit/delete products. everything seems to be working fine, and there doesn't seem to be a need for MySQL or anything. i was wondering if there is anything i'm not thinking of that perhaps would push me to favor using php and mysql instead of the plain old text file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL vs. basic text file
often i use text files at my data sources, delimted by the "|" symbol. i simply delimit the fields of each line, then when i need to open them, i open the text file, populate an array with each line, then explode the fields for each to get the corresponding values. i use this method for catalogs - and even backend interfaces, for which the client can add/edit/delete products. everything seems to be working fine, and there doesn't seem to be a need for MySQL or anything. i was wondering if there is anything i'm not thinking of that perhaps would push me to favor using php and mysql instead of the plain old text file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php