Give small demo of writting OOP in PHP-mysql.



Give small demo of writting OOP in PHP-mysql...

Answer / prakash1991

class class_name extends base_class
{
function function_name()
{
// call base class function
$this->base_class_function();
// function body
}
}

call the function from out side whenever you use

//include the php file where you write the class
include_once 'class_file.php';

$variable_name = new class_name()

// set the variable value that you want to use in function
$variable_name->class_Variable = "";

//call the function
$variable_name->function_name();

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How break and continue while loop in php?

0 Answers  


What language is php based on?

0 Answers  


How to concatenate two strings together in php?

0 Answers  


What are the differences between require and include, include_once?

3 Answers  


Write down the code for save an uploaded file in php.

0 Answers  






What is a php object?

0 Answers  


Explain what is the difference between $var and $$var?

0 Answers  


Which is better php or nodejs?

0 Answers  


What is the use of htmlentities in php?

0 Answers  


What is the content of /etc directory?

0 Answers  


How to convert numbers to strings in php?

0 Answers  


How to use validations in php?(codelgniter)

2 Answers  


Categories