PHP ldap and mysql results merge

Discussion in 'PHP' started by gilbertsavier, Jul 17, 2009.

  1. gilbertsavier

    gilbertsavier New Member

    Joined:
    Jun 25, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Hello,
    I am currently trying to write a quick page for use with our phones, to centralise phonebook results.
    ????: EduGeek.net Forums http://www.edugeek.net/forums/web-development/26654-php-ldap-mysql-results-merge.html

    I have all the staff phone extensions, and email addresses in one place - our active directory. This is kept up to date, as it is a nice place to do so.

    I also have the freepbx 'users' table, which contains a list of all the phone extensions on the system. This includes all the phone numbers from the active directory, but not email addresses. It also has extra extensions such as 'Year 5 block' etc...

    So neither list contains everything.

    Now, rather than having to create Active Directory objects for the non-people extensions, is there a way I can merge the results from a php ldap_search and a mysql_query?

    I made the initial mistake of iterating through each line of the ldap array and if they matched, output one thing, if they didn't then output another. But this meant that every single row contained every single record from the mysql array...

    I can think of one way of dealing with it, this being a third array which I add the index values to when a match is made, which is checked by the above loops, and if that row has already been output then it isn't output again, but this seems very messy.

    So any ideas? I can post snippets of code if that will help.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Yes, please post some snippets!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice