Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

PHP ldap and mysql results merge

Discussion in 'Programming' started by gilbertsavier, Jul 2, 2009.

  1. gilbertsavier

    gilbertsavier New Member Webmaster

    I am currently trying to write a quick page for use with our phones, to centralise phonebook results.
    ????: EduGeek.net Forums PHP ldap and mysql results merge

    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.

    Thanks & regards,

    Live chat By miOOt

Featured Resources (View All)

Share This Page