Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #some class/methods up here...
- public function AddNewUser(User $user) #here is where it's passed in...
- {
- print '<pre>';
- print_r($user); # my output of this is shown in email.
- print '</pre>';
- return;
- $user->Username = $this->db->escape($user->Username);
- $user->Password = $this->db->escape($user->Password);
- $user->Email = $this->db->escape($user->Email);
- $sql = 'CALL sp_RegisterUser(' . $user->Username . ', ' .
- $user->Password . ', ' . $user->Email . ', '
- . (int)((isset($user->RefId) && is_numeric($user->RefId))
- ? $user->RefId : 0) . ', @usersId);';
- $query = $this->db->query($sql);
- if($query)
- {
- $sql = "SELECT @usersId;";
- $query = $this->db->query($sql);
- if($query->num_rows())
- {
- $sqlData = $query->result();
- $query->free_result();
- foreach($sqlData[0] as $k => $v)
- {
- $array[$k] = $v;
- }
- return (int)$array['@usersId'];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement