Page 1 of 1

Application messages

Posted: Tue Apr 21, 2009 11:59 pm
by msurabbott
All,

How *bad* is it to store application success/failure messages in a db table? Heres what I'm doing..

- Add row(s) to db
- Iterate through the rows using PHP, assign each to an array in Smarty
- Truncate the table
- Display the messages in my Smarty template

There is the possibility of a message not being able to write to the db, then there is nothing to report the error, but using Smarty, and header() sometimes to redirect a user from script to script, i can't think of a better way.

The smarty community cannot seem to do so either..

Re: Application messages

Posted: Wed Apr 22, 2009 7:36 am
by miro_igov
Not good to save errors in db that way. How you manage the sessions? If someone raises an error but just in the same time another user opens same file he will see the error of the other and the original user to whom is the error will not see it because it is truncated :roll:

You can use sessions instead.

Re: Application messages

Posted: Wed Apr 22, 2009 10:22 pm
by msurabbott
but i cannot clear the session from my smarty template.. nor can i access the session from inside classes (i create errors from the class in the class file)