PHP: Database Connection Class Constructor Method

前端 未结 6 1017
旧巷少年郎
旧巷少年郎 2021-02-03 16:19

I\'m new to OOP. Originally I was defining variables and assigning values to them within the class and outside of the constructor, but after an OOP lesson in Java today, I was t

6条回答
  •  温柔的废话
    2021-02-03 16:40

    host,$this->username,$this->password))
                {
                    echo "connection successfully";
                }
            }
            function db()
            {
                mysql_select_db($this->$dbname);
            }
        }
    
        $obj=new config();
    ?>
    

提交回复
热议问题