Re: text files instead of mySQL
| From: | Simon Willison | Date: | Wed, 20 Feb 2002 17:37:19 +0000 |
| Subject: | Re: text files instead of mySQL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85560@lists.php.net to get a copy of this message | ||
M.E. Suliman wrote
Is it possible to convert a PHP script that writes and pulls data from a mySQL database to use text files / database instead. Yes it is but you could have a job on your hands depending on the complexity of the script. Personally I favour PHP's serialization capabilities for flat file work - you can take pretty much any object or array (or an array of objects, you can nest them as much as you like) and use serialize() to turn it into a string. You can then save the string in a text file, and later on re-read it and unserialize it to get your original data structure back.However, if the script you are investigating makes heavy use of SQL join syntax you could have a very nasty job on your hands coming up with data structures that can be "queried" in the same way without performance becoming an issue. Simon