Yameen Posted June 17, 2011 Share Posted June 17, 2011 I just purchased my license and I am thrilled with the decision but I am worried it cannot complete the task I need it to: Once a customer completes the order via WHMCS then it should create a new database line in a database I specify. I do not need it to do anything else but create a new line in a database I specify. Can this be done?? 0 Quote Link to comment Share on other sites More sharing options...
Yameen Posted June 18, 2011 Author Share Posted June 18, 2011 Anybody have any ideas on how-to accomplish this? 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted June 18, 2011 Share Posted June 18, 2011 function add_db_row($params) { $db = mysql_connect("dbhost", "dbuser", "dbpass") or die("Error connecting to database."); mysql_select_db($dbname, $db) or die("Could not select database."); $sql = "INSERT INTO `tablename` (`col1`, `col2`, `col3`) VALUES ('val1', 'val2', 'val3')"; mysql_query($sql); } add_hook("AfterModuleCreate", 1, "add_db_row"); http://docs.whmcs.com/Action_Hooks 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.