Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Phonenumbers stored in mySQL database

Hi, 

I would like to know where the phonenumbers of users are stored in the mysql database.

Hope someone can help me a bit.

Thanks!

Comments

  • edited February 2015
    osTicket v1.9.5.1:

    For staff: ost_staff
    For users: ost_form_entry_values
  • osTicket v1.9.5.1: For staff: ost_staffFor users: ost_form_entry_values
    That I understand, but how I can relate that you a specific user? I mean for users not staff :)

    Thanks
  • For users this is not so easy, try to help you next week ;)
  • For users this is not so easy, try to help you next week ;)
    Thanks Chefkeks. I'm also trying to add a new field to user note's. I have added he field, but I need to know where I can find the code that posts it to the DB
  • We use a script to fill the database directly with phone numbers etc. from ldap. I took the following code out of our script and set in some example values (phone number 555 666 7777 and username johndoe) so that you can see how you can select / update the phone number and other fields from an external script. But always remember that you're doing that on your own risk and when you like to use my ldap user info addon it's also at your own risk for sure! ;)

    Here is the sql command:
    update ost_user
    LEFT JOIN ost_user_account on ost_user.id=ost_user_account.user_id
    LEFT JOIN ost_form_entry on ost_user.id=ost_form_entry.object_id
    LEFT JOIN ost_form_entry_values on ost_form_entry.id=ost_form_entry_values.entry_id
    LEFT JOIN ost_form_field on ost_form_entry_values.field_id=ost_form_field.id
    SET ost_form_entry_values.value='555 666 7777'
    WHERE (ost_form_field.name='phone' AND ost_user_account.username='johndoe')";

    My ldap user info addon script:
  • We use a script to fill the database directly with phone numbers etc. from ldap. I took the following code out of our script and set in some example values (phone number 555 666 7777 and username johndoe) so that you can see how you can select / update the phone number and other fields from an external script. But always remember that you're doing that on your own risk and when you like to use my ldap user info addon it's also at your own risk for sure! ;) Here is the sql command: update ost_user LEFT JOIN ost_user_account on ost_user.id=ost_user_account.user_id LEFT JOIN ost_form_entry on ost_user.id=ost_form_entry.object_id LEFT JOIN ost_form_entry_values on ost_form_entry.id=ost_form_entry_values.entry_id LEFT JOIN ost_form_field on ost_form_entry_values.field_id=ost_form_field.id SET ost_form_entry_values.value='555 666 7777' WHERE (ost_form_field.name='phone' AND ost_user_account.username='johndoe')"; My ldap user info addon script: https://github.com/Chefkeks/osTicket-Addons
    Thanks a lot. Helps me miles!:)
  • Very welcome :)
  • I am unable to query phone number using above query. task is to pull user phone number and relate it to username so that i can send sms via kannel gateway. the above query return nothing :(
  • The above query doesn't ask mysql for the phone number... it updates the phone number.
Sign In or Register to comment.