Reputation: 109
I need your help! I'm trying to connect to the Google Cloud SQL instance from a different server (ie.,provided through Hostgator) but I am unable to select the Database (which is already created at Google Cloud SQL) using the mySQL function - "mysql_select_db" in order to store and retrieve data from my application running at Hostgator webhost.
This is the error that I'm getting
Here's the code which am using
Any help would be highly appreciated!!
Update
After correcting the mysql_select_db() function, I'm able to select and insert into the DB table but when I try to retrieve and count the number of rows in the table, I get the following warning
This is the code for the same
Here's the code used to insert the record
mysqli_query($con, "INSERT INTO members VALUES(32, 'Sallu')");
echo "Row inserted";
Thanks
Upvotes: 0
Views: 642
Reputation: 1016
You are using mysqli_connect
but you want to select the database using mysql_select_db
.
Upvotes: 1
Reputation: 760
Use mysqli_* statement
mysqli_select_db($conn,"testing");
mysqli_query("YOUR QUERY..",$conn)
Upvotes: 1