Friday, July 31, 2009

How can I create a simple database with PHP that doesn't require MySQL or ASP?

I need to make a simple database (company names and addresses) but I can't use MySQL or ASP. Does anyone have any templates for PHP or CGI databases?





I know CGI and PHP works with my host, but I know MySQL and ASP don't - and I can't change host at this stage.

How can I create a simple database with PHP that doesn't require MySQL or ASP?
You'd be better off using XML.





http://www.devarticles.com/c/a/PHP/Conve...





http://www.php.net/manual/en/ref.xml.php
Reply:if you have the office suite on your computer, or if your business can by it, use MS ACCESS. Its pretty simple and straightforward. Not for extensive use, but from what you described, it seems like the answer. Plus all the help and tutorials you need to start using it is available online





www.microsoft.com
Reply:You don't need ASP (consider ASP, PHP, and CGI/Perl the same stuff), but you need SOME SORT of database, unless you plan to store the data in pure TEXT, which is going to be slow and cumbersome.





Better investigate what does your host REALLY support besides PHP. In general, if they have PHP, they should have Apache / MySQL.





EDIT: The problem is NOT speed. The problem is concurrency (i.e. multiple users). Basically, you have one user writing something, which means nobody else can be editing the same record, or even READING the same record, and so on. Else you'll have updating problems, who's updating what, and so on. That's why we have databases (oh, and they lookup things much faster).
Reply:In Perl, you can use DBM files, which are hashes (associative arrays) stored as files. I once built a client/project database on a server without MySQL using this approach. I don't know that there's anything similar available in PHP, but if your needs are simple, you could probably make do saving arrays as csv files.





Home-rolled databases are fairly simple to implement, up to the point where you have to accommodate multiple simultaneous users.


No comments:

Post a Comment