Heh, I'm just starting out with learning PHP though it's not really a complex language so that's not too hard to follow. My problem is that I learned procedural and am just now beginning to grasp the basics of OOP.
I threw this together the other day:
Code:
class opendb {
function opendb() {
$this->mysqli = mysqli_connect("blah", "blahblah", "meh", "mehmeh");
return $this->mysqli;
}
}
And then just added this to my script:
Code:
require_once("opendb.php");
$db = new opendb;
$mysqli = $db->opendb();
It serves my purposes at the moment.