Jump to content

Archived

This topic is now archived and is closed to further replies.

desithugg

mysql connect from another domain

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

Share this post


Link to post
Share on other sites
It's possible you don't have GRANT permissions; is this DB on the same machine?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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

Share this post


Link to post
Share on other sites

×

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.