So I have a class with some methods inside of them. I also have a local function which is not apart of any class. My problem is how do I call upon a method inside the class from a localized function? A code example follows:
The Class:
class pages {
public function mysql_extended($dbhost, $dbuser, $dbpass, $dbname) {
$mysql_connect = mysql_connect($dbhost, $dbuser, $dbpass)or die("Could not connect: " . mysql_error());
$mysql_select_db = mysql_select_db($dbname) or die(mysql_error());
echo "Hello World";
}
}
The Localized Function:
function connection_handler() {
$pages = new Pages();
$pages->mysql_extended("localhost", "root", "", "core");
}
This example does not work!
Any help?