Results 1 to 5 of 5

Thread: Database path to User email address

  1. #1
    bazianm is offline Sugar Community Member
    Join Date
    Jan 2005
    Posts
    71

    Default Database path to User email address

    Hi,

    I am writing a companion system that uses the Sugar database. I need to retrieve a user's email address. I am having some difficulty finding the path that gets me from a users table to the email_addresses table. I am missing something in between that links the user row with the email_addresses row.

    Anyone got any ideas?

  2. #2
    imran123 is offline Sugar Community Member
    Join Date
    Feb 2009
    Posts
    137

    Default Re: Database path to User email address

    query:

    SELECT u.id,e.email_address FROM users u INNER JOIN email_addr_bean_rel eab ON eab.bean_id = u.id INNER JOIN email_addresses e ON eab.email_address_id = e.id where ( eab.deleted=0 AND e.deleted=0) ;
    Last edited by imran123; 2013-02-07 at 08:48 PM. Reason: shortened the query

  3. #3
    bazianm is offline Sugar Community Member
    Join Date
    Jan 2005
    Posts
    71

    Default Re: Database path to User email address

    Bless you. Thanks

  4. #4
    bazianm is offline Sugar Community Member
    Join Date
    Jan 2005
    Posts
    71

    Default Re: Database path to User email address

    Out of curiosity, would the path be the same for an email address for a contact? Or a custom module that uses an email field? With the understanding that I would join with the appropriate table other than the users table...

  5. #5
    imran123 is offline Sugar Community Member
    Join Date
    Feb 2009
    Posts
    137

    Default Re: Database path to User email address

    Yeah shoud work with contacts. Not sure about a custom module but you could try

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Apostrophe in new user email address
    By russfordyce in forum Help
    Replies: 22
    Last Post: 2013-02-18, 04:40 PM
  2. Replies: 0
    Last Post: 2012-05-11, 07:26 PM
  3. User Email Address Field Missing
    By jrmckinn in forum Help
    Replies: 1
    Last Post: 2010-10-30, 06:52 PM
  4. User save cause email address to be deleted
    By yannick038 in forum Developer Help
    Replies: 1
    Last Post: 2010-09-06, 10:38 AM
  5. Find Users email address in the database
    By mylo78 in forum Developer Help
    Replies: 4
    Last Post: 2008-06-27, 04:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •