$servername = "localhost";
$username = "*******";
$password = "*******";
$database = "rustoleum";

mysql_connect($servername, $username, $password) or die("Not connected");
mysql_select_db($database) or die("Not connected to the database");


How do I find the servername for my online hosting?    

The chances are it shall be local host, otherwise your hosting provider should have a help section, or it listed alongside your billing information.

If you cannot find it then pop a support query, or email their technical staff who should beable to give it to you in a couple of seconds.

The chances are it shall be local host

no it won't be localhost for most cases.But if you are able to connect then it will be that only.
Check with your hostprovider.They might have send you mail regarding the mysql server connection details.
If not then send a mail to the support team regarding this.Most probably they might have sent you.Check the mail that you received from them while taking space in their server