Connect to database

Once I had set the FTP connection up between Dreamweaver and GoDaddy I created a database in my CPanel and wrote the code below to connect to my database and test the connection.  I entered my username in “USERNAME” and “PASSWORD” in password.

The code then selects the database (enter the database name in “DATABASE”) and returns an mysql_error message if it cannot select the database.

 

 

 

 

 

 

 

 

 

 

 

 

Connection to database sucessful below (as above in code):

Screen Shot 2016-01-05 at 16.08.15

 

 

 

 

 

 

 

 

 

 

Advertisements