Forum Moderators: coopster
I have searched the 'net for an example/tutorial showing me how to stucture my application, with the above problem as a typical issue. Can anyone point me to a "comprehensive" (but not too complex) example or tutorial which I can study and follow as a model ?
Another "decision" which would also be covered in a "structure" example or tutorial, is whether to open the database connection when I open the application, or to open and close it only when processing data. In the examples I have found, I have seen both systems used. Are there different applications for each system ?
Thanks for all help offered.
The way most people do this is to,
1) Store the message you want to display in the SESSION
2) Redirect the user to the next page
3) Get the message from the session, display it, and wipe the session of the message
As for DB connections, I only create a connection when one is needed. I use MySQLi and store my connection instance in one global place (using a Singleton is know of them). When I request the connection, one is created if it doesn't exist, otherwise it just returns the active connection.