I'd definitely say to contact you host for this info. For example, if phpmyadmin was already set up when you opened your hosting account, you might have never known these details.
Your username and password are probably (but maybe not) the same as those you use to log in to phpmyadmin. The database name should be shown in your phpmyadmin panel. As for "server," different hosts have different ways of configuring them and different ways of allowing access from your sites.
Once you have determined your database credentials, use them in place of the "server, username, password, database" in your code. However, for security reasons, always ********* them when you post your code here (or anywhere online).
On a related subject, mysql_connect() does not accept the database and/or table name as an argument:
PHP Code:
// the fourth argument is (boolean)new_link, not the database name.
// if you put anything there (other than FALSE), it will simply be interpreted as "true"
// it won't throw an error, but it won't do what you expect, either.
mysql_connect('servername','username','password','databasename');
// this will have no result
$r = mysql_query("select * from table");
// and this will return:
// " No database selected. "
print mysql_error();
// leave 'databasename' _out_ of mysql_connect()
// you need to use this after you connect:
mysql_select_db('databasename');
//and then you can continue with your queries
Bookmarks