By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

MySQL database connection: what to put for hostname?

P: 1
I am using PHP, Mysql , Apache on Debian

i tried to connect database but cannot connect.

my host name is = debianpink

my IP address is = 192.168.1.132

domain name is = orjpn.co.jp

my code is as follows
--------------------------------------------
$hostname = '';
$dbname = 'phpmysimplelogin';
$username = 'root';
$password = 'abc';

// Let's connect to host
mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!');
// Select the database
mysql_select_db($dbname) or DIE('Database name is not available!');
Feb 9 '12 #1
Share this Question
Share on Google+
1 Reply


P: 23
what error do you get?

is it connection to host is failed or the second one database name in not available.


Reply
Feb 11 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.