I am working on creating an actionhook to insert data into a database shared by multiple hosting accounts.
The code works, however, as soon as the shared hosting account is created I recieve an error message stating "Service ID Not Found".
I am thinking that maybe this error occures from a conflict due to the opening of two seperate databases, maybe I am wrong. I just need some additional tips here.
Thanks!
Here is my code:
function generate_variables($vars) {
$tri_systemurl = "http://" . $vars['params']['domain'] . "/";
$tri_afflink = "?aff=" . $vars['params']['clientsdetails']['userid'];
$tri_afflinkamp = "&aff=" . $vars['params']['clientsdetails']['userid'];
$tri_db_info['username'] = "<REMOVED>";
$tri_db_info['password'] = "<REMOVED>";
$tri_db_info['host'] = "localhost";
$tri_db_info['dbname'] = "<REMOVED>";
$tri_db_info['connection'] = mysql_connect($tri_db_info['host'], $tri_db_info['username'], $tri_db_info['password']) or die(mysql_error());
$tri_query = "INSERT INTO sites VALUES('0','$tri_systemurl','$tri_afflink','$tri_afflinkamp');";
@mysql_db_query($tri_db_info['dbname'], $tri_query, $tri_db_info['connection']);
mysql_close($tri_db_info['connection']);
}
add_hook("AfterModuleCreate",1,"generate_variables");