Give small demo of writting OOP in PHP-mysql.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me which function gives us the number of affected entries by a query?

525


How do you end a function in python?

540


Is php a cms?

532


How to get number of days between two given dates using PHP?

483


How can we access the data sent through the url with the get method?

596






Explain what are the three classes of errors that can occur in php?

528


What can php do?

551


How to read a file in php?

525


What is baseurl?

534


what is mean by portal

1466


When to use get and post request?

553


What is uniqid php?

578


How cookies are trported from browsers to servers?

572


What is the content of /etc directory?

566


Why sessions are used in php?

509