I recently moved my website (currently still in development) from one server to another, and all of a sudden, my PHP code is giving errors. What baffles me is that the new server is owned by the same hosting company, 000 webhost (not the most reliable, but free), and therefore runs the exact same software.
<?php
//URL Data Retrieval
$uuid = $_GET['uuid'];
// MYSQL Server Connection Info
$host="..."; // Host name
$username="..."; // Mysql username
$password="..."; // Mysql password
$db_name="..."; // Database name
$conn = mysql_connect($host, $username, $password);
// MYSQL Data Retrieval
$sql ="SELECT ProductID, name, description, description2, price, saving FROM product_list WHERE ProductID ='$uuid'";
mysql_select_db($db_name);
$retval = mysql_query($sql, $conn );
if(! $retval )
{
$error = "Sorry, we could not find this in our database. Please press your browser's back button, and try again.";
die("");
}
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
{
$name = $row['name'];
$description = $row['description'];
$description2 = $row['description2'];
$price = $row['price'];
$saving = $row['saving'];
}
mysql_close($conn);
?>
The code first takes some data from the URL, which works fine, it's the next part that doesn't work.
Here are the errors:
Warning: mysql_connect() [function.mysql-connect]: Host '10.1.1.24' is not allowed to connect to this MySQL server in /home/a9790178/public_html/display.php on line 12
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'a9790178'@'localhost' (using password: NO) in /home/a9790178/public_html/display.php on line 17
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a9790178/public_html/display.php on line 17
PHP Error Message
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a9790178/public_html/display.php on line 18
And a link to the site: http://discountpenguin.comyr.com/display.php?uuid=1