Try the following instead:
Hostname: 127.0.0.1
username: your_user
password: your_pass
database: sakila
Code:
$mysqli = new mysqli('127.0.0.1', 'your_user', 'your_pass', 'sakila');
reference
Below is a more realistic example of how it looks for me and pulls and displays a title where the ID is "3" and the table name is "article". The hostname below is using random numbers instead of the actual numbers and the part that says "localhost" is renamed so as to protect the actual name of my database.
Code:
<?php
$conn = new mysqli("localhost.db.039850.hostedresource.com", "username", "password", "dbname");
mysqli_select_db($conn,"dbname") or die(mysqli_error());
$ID=3;
$get_addresses = "SELECT ID, title FROM article WHERE = $ID";
$get_addresses_res = mysqli_query($conn,$get_addresses);
$add_info = mysqli_fetch_array($get_addresses_res);
$title = $add_info['title'];
echo "$ID";
?>
Notice that mysqli() function is being used instead of the deprecated mysql().
Bookmarks