Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- $email = $post['email'];
- $password = sha1( md5( pg_escape_string( $post['password'] ) ) );
- $this->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- $this->beginTransaction();
- $prepared = $this->prepare( "INSERT INTO ".TP."_users (email, password) VALUES ( '$email', '$password' )" );
- $prepared->execute;
- } catch ( PDOException $e ) {
- $db_err = $e->getMessage();
- $this->rollBack();
- $response = array(
- 'ok' => false,
- 'msg' => $db_err );
- return $response;
- }
- $this->commit();
- $uid = $this->lastInsertId('users_id_seq');
Advertisement
Add Comment
Please, Sign In to add comment