Jump to content

aarkeys

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aarkeys's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The PHP Script is running on the server. The server connects to the remote PC and i have tested it by querying the database at the remote PC. I am doing the following : 1) Connecting to the remote PC - successfully connected as i can query the remote DB 2) Connecting to the DB on webserver - successfully connected 3) The problem occurs only when i run the query to retrieve the records from remote and update the local webserver where it denies the permission.
  2. Dear All, I am having 2 different DB on 2 different hosts. I am running MySQL Server on my local PC where the user is entering data in the tables. I have a website which has the identical DB on the web. I am able to connect to the database by using the codes on the server. I want to update the server DB with the local system DB by running one update command. I get the error "-SELECT command denied to user 'localusername'@'localhost' for table 'pst_data'" Given below is the code used for the process : //connecting the remote system DB $link = mysql_connect('IPAddress:3306', 'remoteusername', 'Password'); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db('remotedb', $link); if (!$db_selected) { die ('Can\'t use Remote System DB: ' . mysql_error()); } //connecting the local database on the webstite $weblink = mysql_connect("localhost","localusername","password"); if (!$weblink) { die('Not connected : ' . mysql_error()); } $webdb_selected = mysql_select_db('localwebdb', $weblink); if (!$webdb_selected) { die ('Can\'t use WebServer Database : ' . mysql_error()); } //query to fetch the records from remote ystem and insert into local website database $upd_Query=mysql_query("INSERT INTO localwebdb.`table` SELECT * FROM remotedb.`table` where field=' some condition' "); --------------------------------------------------- I have tested that I have connected the remote DB by running queries on the webserver. Could anyone bail me out so that i can copy the DB from remote to local Any help would be appreciated
×
×
  • 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.