Guest User

Untitled

a guest
Sep 1st, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. try {
  2.             $email = $post['email'];
  3.             $password = sha1( md5( pg_escape_string( $post['password'] ) ) );
  4.             $this->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
  5.             $this->beginTransaction();
  6.             $prepared = $this->prepare( "INSERT INTO ".TP."_users (email, password) VALUES ( '$email', '$password' )" );
  7.             $prepared->execute;        
  8.         } catch ( PDOException $e ) {
  9.             $db_err = $e->getMessage();
  10.             $this->rollBack();
  11.             $response = array(
  12.                 'ok'    =>  false,
  13.                 'msg'   =>  $db_err );
  14.             return $response;
  15.         }
  16.         $this->commit();
  17.         $uid = $this->lastInsertId('users_id_seq');
Advertisement
Add Comment
Please, Sign In to add comment