hideipvpn Posted September 5, 2009 Share Posted September 5, 2009 Hi all, I have a hook that work on ClientEdit. I made some tests and it's looks like when you try to select client info from database after user pressed "Save Changes" button that data is old one!!! I need to get updated data: email and one custom field. Why it's not working ? Here is my code (not all) function change_vpn_password($vars) { $vars = func_get_args(); $idclient = $vars[0]; ................. $select = "SELECT id,email,status FROM `tblclients` where status='Active' AND id='$idclient'"; .............. $id = $row['id']; $user = $row['email']; // getting custom filed $sel_pass = "SELECT value FROM `tblcustomfieldsvalues` WHERE fieldid='7' AND relid='$id' "; $rez_pass = mysql_query($sel_pass) or die ('Error udating database'); $pass = mysql_result($rez_pass, 0); echo $str = $user ." " .$pass ."\n"; } add_hook("ClientEdit",0,"change_vpn_password"); 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.