/Users/johnr/Desktop/IA pdf Downloads/_New Projects Downloads May 7th/CS_IA_Mattew/MySQLConn.class.php
 1 <?php
 2 class MySQLConn {
 3   //private properties: the log in information for the mysql database
 4   private $dns = 'localhost';
 5   private $user = 'root';
 6   private $pass = 'isb19052';
 7   private $dbname = 'Golfasian';
 8   //only this class and child classes can use this method to connect to the mysql database
 9   protected function connect() {
10     //connection to database
11     $conn = new mysqli($this->dns,$this->user,$this->pass,$this->dbname);
12 
13     if ($conn->connect_error) {  
14       return "Connection failed: ".$conn->connect_error;
15     }else{
16       return $conn;
17     }
18   }
19 }
20 
21 ?>
22