Help me solve a small problem. Thank you & lt ;? Phpabstractclassabs_db {// abstract class abstractprotectedfunsabconnect (); // database connection abstractprotectedfunctionselect_db (); // select database abstractprotect to help me solve a small problem. thank you.
Abstract class abs_db {// abstract class
Abstract protected function connect (); // database connection
Abstract protected function select_db (); // select a database
Abstract protected function setchar (); // character settings
Abstract protected function query (); // query
Abstract protected function getAll (); // Retrieve a portion of the query
Abstract protected function getOne (); // retrieves
Abstract protected function error ();
}
Class mysql extends abs_db {
}
?>
The error message "Class 'mysql' must implement inherited abstract method" appears in the preceding code.
'Error (...) 'What is the cause? how can this problem be solved? The compiler I use is zend studio 9.0.3.
------ Solution --------------------
That is to say, a subclass inherits a parent class, and this parent class is an abstract class. Therefore, you must implement all functions in the parent class within the subclass class.
For example:
PHP code
Abstract class A {funcA ();}