ThePsion5 Posted June 22, 2006 Share Posted June 22, 2006 I have an idea...like the topic says, it could be a really good idea or a very poor idea. I thought that since alot of people don't like having to install a database on their servers but want limited database functionality, that it might be possible to implement a pseudo-database using XML. But you can't just store the info in an XML file because then anyone could open it and read your possibly confidential information. So I thought of putting the XML into a PHP variable. Obviously there is one major obstacle for this:How do you update the PHP variable in a way that won't just revert back to the hard-coded values once the server is restarted? I thought about using file functions to write directly to the PHP file containing the variable, but I'm not sure if that would work. Feedback, anyone? Link to comment Share on other sites More sharing options...
DarkElf Posted June 22, 2006 Share Posted June 22, 2006 It's possible to rewrite the php files everytime you update the variables, you just need to set the correct access permissions on the files.But you are creating hurdles you don't need to! What you are effectively talking about is flat files, these used to be all the rage before relational databases. The reason relational databases are now used so commonly is because they are much better at the job.If you really want to use a flat file system I would go back to your xml files. Just place them in a folder without public access, that way a public request for them will be denied but your php scripts (executed on the server) will still be able to access them and do what you want with them. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2006 Share Posted June 22, 2006 I agree with DarkElf. But if you want to go the route of writing your own PHP files, look at this thread:http://w3schools.invisionzone.com/index.php?showtopic=4356 Link to comment Share on other sites More sharing options...
aspnetguy Posted June 22, 2006 Share Posted June 22, 2006 Isn't reading/writing xml files slower than a database??? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2006 Share Posted June 22, 2006 It probably is a little bit faster, but I'm finding that for most things I do on the web, speed issues like that don't really matter unless you're doing them in a loop or something. They are still relatively fast. I have a counter on the pages I'm developing that shows me how many SQL queries the page took, and the total execution time from start to end. Even though a page taking either .02 seconds or .2 seconds to execute is an entire order of magnitude higher, in reality the 2 or 3 seconds that it takes to transfer the page through HTTP overshadows anything like that. But like I said, if you are executing a loop 10,000 times or something to process a page, then a little efficiency goes a long way. Link to comment Share on other sites More sharing options...
Little Goat Posted June 22, 2006 Share Posted June 22, 2006 well, if people want the functionality of SQL but the server doesn't have it, then just use SQLite. http://us3.php.net/sqlite am I the only one who has heard about this?? *looks at the link* wel, it turns out you do have to configure it, but no sofware download. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now