tfghost Posted March 23, 2013 Share Posted March 23, 2013 Hello I am currently trying to setup an action hook for on ClientAdd that will automatically retrieve a Reference Number from the table bpayref and the cell RefNumber. I have tried this code in standard php, just echoing the variable $bpayref1 and it worked successfully, however I am unable to get it to pull into the Database. I am just wondering if I have missed something and if anyone could please help me with this issue. The code is below . Thanks in advance. Kind Regards Jeremy Chequer National Operations Manager TFG Servers Pty Ltd function addbpay($vars) { $email = $vars['email']; $query = "SELECT * FROM bpayref"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); $bpayref1 = $row['RefNumber']; mysql_query("UPDATE tblclients SET bpayref=$bpayref1 WHERE email=$email") or die(mysql_error()); mysql_query("DELETE FROM bpayref WHERE RefNumber=$bpayref1") or die(mysql_error()); } add_hook("ClientAdd",1,"addbpay"); 0 Quote Link to comment Share on other sites More sharing options...
omnigenus Posted March 23, 2013 Share Posted March 23, 2013 Just quickly lookin at it, try changing your update line to: mysql_query("UPDATE tblclients SET bpayref='".$bpayref1."' WHERE email='".$email"'); 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.