Lodius2000 Posted January 16, 2009 Share Posted January 16, 2009 In a method, are functions defined by php preceded by a @ I'm looking into the guts of a DBabstraction and seeing this <?php function simpleQuery($query) { $this->last_query = $query; $query = $this->modifyQuery($query); //next line is what i'm talking about $result = @msql_query($query, $this->connection); if (!$result) { return $this->msqlRaiseError(); } // Determine which queries that should return data, and which // should return an error code only. if ($this->_checkManip($query)) { $this->_result = $result; return DB_OK; } else { $this->_result = false; return $result; } } ?> but then in the same document, I see this <?php function freeResult($result) { return is_resource($result) ? msql_free_result($result) : false; } ?> now I know mysql_query and msql_free_result to be functions included in mysql enabled installs of php, so whats the diff of using the @ and not? Link to comment https://forums.phpfreaks.com/topic/141016-solved-oop-using-php-defined-functions/ Share on other sites More sharing options...
Prismatic Posted January 16, 2009 Share Posted January 16, 2009 @ suppresses errors generated by a function Link to comment https://forums.phpfreaks.com/topic/141016-solved-oop-using-php-defined-functions/#findComment-738067 Share on other sites More sharing options...
corbin Posted January 16, 2009 Share Posted January 16, 2009 "now I know mysql_query and msql_free_result to be functions included in mysql enabled installs of php, so whats the diff of using the @ and not? " mSQL != MySQL. Link to comment https://forums.phpfreaks.com/topic/141016-solved-oop-using-php-defined-functions/#findComment-738077 Share on other sites More sharing options...
Lodius2000 Posted January 16, 2009 Author Share Posted January 16, 2009 corbin... yeah saw that I had opened the wrong document, I had opened the msql not mysql, but i checked out what was in the mysql and it had the same sorts of things Prismatic... that explains it because this DBA has its own error reporting SOLVED Link to comment https://forums.phpfreaks.com/topic/141016-solved-oop-using-php-defined-functions/#findComment-738081 Share on other sites More sharing options...
corbin Posted January 16, 2009 Share Posted January 16, 2009 If you're super concerned about speed, I've heard that error suppressing can cause some major slow downs in function calls. Never tested it my self or anything though. Link to comment https://forums.phpfreaks.com/topic/141016-solved-oop-using-php-defined-functions/#findComment-738088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.