daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Jun 8th, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     #some class/methods up here...
  3.        
  4.         public function AddNewUser(User $user) #here is where it's passed in...
  5.         {
  6.             print '<pre>';
  7.             print_r($user);  # my output of this is shown in email.
  8.             print '</pre>';
  9.             return;
  10.            
  11.             $user->Username = $this->db->escape($user->Username);
  12.             $user->Password = $this->db->escape($user->Password);
  13.             $user->Email    = $this->db->escape($user->Email);
  14.            
  15.             $sql   = 'CALL sp_RegisterUser(' . $user->Username . ', ' .
  16.                         $user->Password . ', ' . $user->Email . ', '  
  17.                         . (int)((isset($user->RefId) && is_numeric($user->RefId))
  18.                         ? $user->RefId : 0) . ', @usersId);';
  19.             $query = $this->db->query($sql);
  20.            
  21.             if($query)
  22.             {
  23.                 $sql   = "SELECT @usersId;";
  24.                 $query = $this->db->query($sql);
  25.                
  26.                 if($query->num_rows())
  27.                 {
  28.                     $sqlData = $query->result();
  29.                     $query->free_result();
  30.                    
  31.                     foreach($sqlData[0] as $k => $v)
  32.                     {
  33.                         $array[$k] = $v;
  34.                     }
  35.                    
  36.                     return (int)$array['@usersId'];
  37.                 }
  38.             }
  39.         }
  40.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top