Is the error i get trying to connect to my db.

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'http://www.fleethabari.com/' (1) in /home/www/fleethabari.com/inc/config.php on line 2
Unable to select database: Unknown MySQL server host 'http://www.fleethabari.com/' (1)
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /home/www/fleethabari.com/inc/config.php on line 8


$conn=mysqli_connect("http://www.xxx.com/","xxx","xxx","xxx");
    // Check connection
    if (mysqli_connect_errno($conn))
      {
      echo "Unable to select database: " . mysqli_connect_error();
      }
    mysqli_close($conn);

But my app is written in mysql and not in mysqli, i hope this is not a problem

Recommended Answers

All 4 Replies

http://www.fleethabari.com/ is not a host, but an URL. If you think it's correct, try www.fleethabari.com, but are you sure you shouldn't be using localhost ?

when i use

localhost

this what i get

Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'cambixgh'@'localhost' (using password: YES) in /home/www/fleethabari.com/inc/config.php on line 2
Unable to select database: Access denied for user 'cambixgh'@'localhost' (using password: YES)
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /home/www/fleethabari.com/inc/config.php on line 8

only difference is this

 Unable to select database: Access denied for user 'cambixgh'@'localhost' (using password: YES)

Do i have to use an IP Address ? How do i get it?

Access denied for user

Means there is a MySQL server, but the name/password is incorrect.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.