MySQL database connection: what to put for hostname?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinkyLwin
    New Member
    • Feb 2012
    • 1

    MySQL database connection: what to put for hostname?

    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 = 'phpmysimplelog in';
    $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!');
  • Joseph Cobham
    New Member
    • Jan 2012
    • 23

    #2
    what error do you get?

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


    Reply

    Comment

    Working...