I have seen differing ways to pass values to a class:
$db=new mysqlclass('loc alhost','user', 'passwd','datab ase');
.....
OR
$db=new mysqlclass()
$db->host='localhos t';
$db->user='user';
$db->passwd='passwd ';
$db->database='data base';
.....
To me, the second looks like more typing. But if the argument list to the
class changes, the latter would not be effected. I am trying to drag my
brain (kicking and scratching) into OOP. Any thoughts on this would be
appreciated.
Thanks
Dan
$db=new mysqlclass('loc alhost','user', 'passwd','datab ase');
.....
OR
$db=new mysqlclass()
$db->host='localhos t';
$db->user='user';
$db->passwd='passwd ';
$db->database='data base';
.....
To me, the second looks like more typing. But if the argument list to the
class changes, the latter would not be effected. I am trying to drag my
brain (kicking and scratching) into OOP. Any thoughts on this would be
appreciated.
Thanks
Dan
Comment