Delete all these and add these lines:
$connect = mysql_connect("your ip goes here", "your username here", "your password here");
mysql_select_db("your database name", $connect);
Just replace the content inside the quotes.
In the part which says "your ip goes here" you have to write "localhost" if you run the website at the same machine you run your server, or your ip if your website and your server are on different machine.
In the second case, when the server and site are on different machine, you also have to open the port, which you had set on mysql when you installed it.