Jump to content

Recommended Posts

umm the problem is i cant get it to connect to a db on my other website
[code]
<?php
mysql_connect("www.t****g.*******.com", "*****", "******") or
   die("Could not connect: " . mysql_error());
mysql_select_db("tpf");

$result = mysql_query("SELECT thing FROM signup where username = 'desithugg'");
if (!$result) {
   echo 'Could not run query: ' . mysql_error();
   exit;
}
$row = mysql_fetch_row($result);
$thing = $row[0];

if ($thing == "") { $thing = "None"; }

echo $thing;
?>
[/code]


i think its because i cant get it to grant access to the webiste i used this query
[code]
GRANT ALL ON database. * TO '*******'@'www.t****g.******.com' IDENTIFIED BY '*******'
[/code]

when i execute that GRANT query it gives me
[code]
#1044 - Access denied for user '******'@'localhost' to database 'tpf' [/code]
it keeps denying the query but the username and password is right
Link to comment
https://forums.phpfreaks.com/topic/11113-mysql-connect-from-another-domain/
Share on other sites

[!--quoteo(post=379755:date=Jun 3 2006, 06:42 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 3 2006, 06:42 PM) [snapback]379755[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It's possible you don't have GRANT permissions; is this DB on the same machine?
[/quote]
no they are 2 different websites
1)www.***.byethost32.com
2)www.***.byethost2.com

i wanna connec to the database of site #1 from site #2
[!--quoteo(post=379951:date=Jun 4 2006, 12:57 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 4 2006, 12:57 PM) [snapback]379951[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It's possible that the host has not permitted non-localhost connctions -- that's why I asked if they were on the same box or not.
[/quote]

o.o lol you were right my host doesnt permit me to grant permissions to non-localhost
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.