ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My boss wants me to make a version of our company's web app that allows a guest user to look around inside the system to see the product features.
Would it be possible to set up a duplicate database to in Postgresql so you cannot really save changes? I would like to have it so I do not have to reprogram anything, the database will accept commands like add and update but it would just be unable to actually save them- the changes would just go nowhere.
Anyone? I need help here- if a knowledgeable person thinks this is impossible, please let me know and I will go with my plan B idea, static HTML output captures of my web application.
I don't know how big or complex your database is, but maybe you can make temporary copies of the database, or a scaled-down version of it, for use by the web app. I just tried using postgresql's creatdb command to make a copy of a database containing 16 tables each having about 5000 - 10000 rows of 4 to 12 columns. It took 4 seconds on a 2 GHz P4, which might be acceptable on a web server that is not too heavily loaded. The temporary databases could be pruned on a scheduled basis, or tied to your web app's session management system for deletion, or both. Just a thought.
I implemented this solution by adding an IF clause in PHP to the part of my script that actually processed the SQL query, if the $_SESSION['demo'] variable is set to TRUE, then the query does not run.
Somewhat inelegant, since I had to add this clause to three seperate pages, but still it works fine. Good thing I run all my regular queries through one function!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.