fourlincoln10 Posted April 23, 2007 Share Posted April 23, 2007 Hi, I'm trying to suppress error messages from the pear MDB2 function MDB2::Connect in a database access class I'm writing. I tried the folllowing, but I'm getting a syntax error. Would someone please tell me the proper way to suppress errors from the function? It appears to be related to assigning a reference as the syntax error goes away when I do normal assignment. $this->conn =& @MDB2::connect($dsn, $upc); Thanks, Troy Quote Link to comment https://forums.phpfreaks.com/topic/48349-solved-suppression-error/ Share on other sites More sharing options...
MadTechie Posted April 23, 2007 Share Posted April 23, 2007 erm... OK try @$this->conn =& @MDB2::connect($dsn, $upc); :-\ Quote Link to comment https://forums.phpfreaks.com/topic/48349-solved-suppression-error/#findComment-236393 Share on other sites More sharing options...
fourlincoln10 Posted April 25, 2007 Author Share Posted April 25, 2007 I tried that...should have included that in my original post. I'm still getting the following error when I pass in an invalid dsn: MDB2 Error: not found Quote Link to comment https://forums.phpfreaks.com/topic/48349-solved-suppression-error/#findComment-237779 Share on other sites More sharing options...
trq Posted April 25, 2007 Share Posted April 25, 2007 More than likely the MDB2 class has its own error handling as the error you are receiving is not a php error. If that is the case, the error suppressor will have no effect. Quote Link to comment https://forums.phpfreaks.com/topic/48349-solved-suppression-error/#findComment-237782 Share on other sites More sharing options...
fourlincoln10 Posted April 25, 2007 Author Share Posted April 25, 2007 You're right. Thank you. It throws a PEAR error. Many thanks! Quote Link to comment https://forums.phpfreaks.com/topic/48349-solved-suppression-error/#findComment-237785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.