Jump to content

ClientAdd Hook Issue


tfghost

Recommended Posts

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");

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated