Jump to content

Recommended Posts

If you are trying to connect to an external database, permissions must be set on that database to allow access.  For example, with MySQL, you could need to grant access:

 

GRANT ALL PRIVILEGES ON db_name.* TO username@'IP_ADDRESS_HERE' IDENTIFIED BY 'password_here';

 

Then you create a new database connection using the above information.

 

EDIT: Forgot to mention if they are not using the default MySQL port you will need to define that as well.

what IP address is that exactly, lets say we have

 

SERVER 1 & SERVER 2

 

server 1 holds the data

server 2 connects to server 1 for the data

 

so whose who in that situation?

 

sorry this part really baffles me, using localhost and keeping it all internal, no problem for me, but its vital that we get an external connection :/

 

thankyou"

i have cpanel so i edited the remotesql  and added SERVER2

 

and in the php script i have this...

<?php
$host="174.37.172.25"; // Host name 
$username="db_System"; // Mysql username 
$password="password"; // Mysql password 
$db_name="table_StaceyOfficialLoginSystem"; // Database name 
$tbl_name="guestbook"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect server "); 
mysql_select_db("$db_name")or die("cannot select DB");

$sql="SELECT * FROM $tbl_name ORDER BY id DESC LIMIT 1;";
$result=mysql_query($sql);

while($rows=mysql_fetch_array($result)){
?>

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.