Danny620 Posted September 5, 2009 Share Posted September 5, 2009 hi i have just started to learn oop and i was wondring if i am doing a db class corretly <?php class connect { var $user = '*****'; var $pass = '*****'; var $host = 'localhost'; var $db_name = '*****'; function connect() { $dbc = mysqli_connect($this->user,$this->pass,$this->host,$this->db_name); if (!$dbc) { return ('Could not connect to MySQL: ' . mysqli_connect_error() ); }else{ return $this->name; } } } ?> Link to comment https://forums.phpfreaks.com/topic/173243-dbc-class/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.