Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class dbconn {
- public function connect() {
- $servername = "localhost";
- $username = "user";
- $password = "user_pass";
- $dbname = "db";
- //to return the db connection
- $conn = new mysqli($servername, $>username, $password, $dbname);
- return $conn;
- }
- }
- $this->connect()->select_db("new_db_name"); //does not select "new_db_name", instead it remains in the default db
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement