Reply to Exc Handling and User Friendly, Secure ErrMsgs

Your name:

Reply:


Posted by awebguynow on 01/18/06 20:59

In my efforts to design a good Database layer, I've used exceptions and
wanted to implement best practices for this project. Obviously an
uncaught exception creates a Fatal Error and stops execution.

Currently, I see the best scenario, as:
if there is an error in the DB layer, throw a DBexc which effectively,
logs all SQL and problem info. In the catch block, throw a general
error, with a more generic statement, and possibly include a logging ID
or # with it. ( avoids sending SQL statements to the screen )

Does this sound sensible, or the best way to do this ?
other options ?
is is common to use set_error_handler ?
What about recovery ? does execution have to terminate ?

I'm also interested in programming this system, with security in mind,
ie: avoid SQL injection.
I haven't researched it fully, but I have seen posts, reccommending
addslashes(), etc.

I'm using PEAR::DB, and looking forward to any responses.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация