ballhogjoni Posted March 29, 2008 Share Posted March 29, 2008 How do you write to a db from a sub domain url? Example: test.example.com I ask because i can't write to my db from a sub domain. i copy the same code and place it on the base domain and it works just fine. Link to comment https://forums.phpfreaks.com/topic/98436-how-do-you-write-to-a-db-from-a-sub-domain/ Share on other sites More sharing options...
benjaminbeazy Posted March 29, 2008 Share Posted March 29, 2008 must be the host setting for user priveleges in mysql. if you have phpmyadmin.. click the home icon, click priveleges, click the edit box next to your user and see what the host is.. the host may be your domain as opposed to localhost or an ip. if so, change it to localhost Link to comment https://forums.phpfreaks.com/topic/98436-how-do-you-write-to-a-db-from-a-sub-domain/#findComment-503761 Share on other sites More sharing options...
ballhogjoni Posted March 29, 2008 Author Share Posted March 29, 2008 I checked that too, I have all privileges. Also it is set to localhost. my connect code: mysql_connect('localhost','xxxxxxxxx','xxxxxxxxxxxx') or die(mysql_error()); mysql_select_db('xxxxxxxxxx') or die(mysql_error()); I am trying to write to a wordpress database if that makes a difference. Link to comment https://forums.phpfreaks.com/topic/98436-how-do-you-write-to-a-db-from-a-sub-domain/#findComment-503764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.