Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is the difference between apache vs niginx?

1015


Which method do you follow to get a record from a million records? (Searching not from database, from an array in php)?

939


How to write the form tag correctly for uploading files?

922


Which php framework is fastest?

947


How do you pass a variable by value in php?

952


What are the main error types in php and how do they differ?

1272


Php code to find whether a number armstrong or not?

915


How is csrf token generated?

942


What does the unlink() function mean?

1023


Do you know what's the difference between __sleep and __wakeup?

957


How do I check if a given variable is empty?

888


What are the delimiters in php?

930


Explain me what are the 3 scope levels available in php and how would you define them?

1150


Why json is used in php?

951


Is php better than java?

937