SteveE Posted September 8, 2009 Share Posted September 8, 2009 Hello Two questions for anyone who can help I am trying to make a server mod using the server mod template. this requires me to right to a mysql db on a different host. however i cannot get this to work. if the database is on the same host i can get this right using select blabla from database.table....... but on a different host i cannot get this right using the following, which i assume is the correct way to do it mysql_query(blablabla, $db); and i was wondering.... the are fuctions in the server module template for create, terminate, change password and so, but can additional ones like change username be added? thanks 0 Quote Link to comment Share on other sites More sharing options...
ckh Posted September 8, 2009 Share Posted September 8, 2009 On the server with the database you are trying to connect to, make sure that the firewall port is open and that the server's IP is allowed as a mysql remote access host. Also, make sure you are opening the connection and selecting the database before executing a query. 0 Quote Link to comment Share on other sites More sharing options...
SteveE Posted September 8, 2009 Author Share Posted September 8, 2009 I have covered those, several times actually. truthfully, i have been stuck on this for a while, working around the issue, but using and database on the same host and using "select * from $db.table" and then just replicating the db offsite something i maybe should've mentioned off the bat is that. before trying to run even one sql query on the other host, i have a query that has to write into the WHMCS db. when i test the script, using mod create, it seems though my opening another connection is causing the whmcs db connection to fail gives this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/includes/adminfunctions.php on line 0 am i correct in saying, that in my db connect function i should use true for new link? 0 Quote Link to comment Share on other sites More sharing options...
bin_asc Posted September 11, 2009 Share Posted September 11, 2009 I`m not sure what you`re doing but you could try to mysql_close() the database connection from WHMCS, and instantiate a new one. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.