I have a database on localhost that works fine.
I have tried to get this onto Google Cloud with XXAMP and Bitnami following all the steps on the following link:
https://www.apachefriends.org/docs/host ... oogle.html
The php files have been transferred to the google cloud. I am trying to access them in the google cloud, and I can access them there. However, the connection to the db and/or the mySQL query I using in the php file does not work. Phpmyadmin works and I am able to log into it in the cloud and amend things and run SQL from within phpmyadmin.
Code: Select all
<?php
echo"<b>MY SITE";
$dbhost = '12.345.67.890'; // this is the URL, and it works successfully to give me access to phpmyadmin, so I know it is correct
$dbuser = 'root';
$dbpass = 'AbcdEFghIJk'; // this is the password I use to get into phpmyadmin
$db = 'pred'; // this is the name of the database
echo"<p>blah blah";
mysql_connect($dbhost,$dbuser, $dbpass) or die ('Unable to connect to database! Please try again later.');
mysql_select_db($db);
?> "MY SITE
blah blah"
Any suggestions on what I need to do to get this working?
Much appreciated
Mark