0

I have installed the Phone module to create a field to take input data as mobile number.

I would like to fetch the mobile number back from database to be displayed in a block. I am not getting the table in which the phone number is stored. So in which table is the phone number data is stored?

3
  • To which entity did you add the phone number field?
    – AjitS
    Commented Mar 8, 2013 at 12:10
  • 1
    In Drupal there are many other ways than fetching the values from database directly by your code. But it depends on how, when and from which part of the module you want to fetch data. drupal.org/node/1074360
    – niksmac
    Commented Mar 8, 2013 at 12:13
  • In Administration->Structure->Profile types and added to main profile as a field
    – fortytwo
    Commented Mar 8, 2013 at 12:30

1 Answer 1

1

If this module defines a field, then the table is named after that field. So if your field is called field_phone, the table is called "field_data_field_phone". However, getting the value direct from the database is not the right "Drupal way" to do it.

You say you want to display the phone number in a block, but I assume this is within a specific context, such as on a page for a node or user. One way to do this would be to use the Views module to define a block with whatever fields you wish to display, using a contextual filter to get the node or user ID from the page arguments.

But more information is needed in order to say whether this is the right answer or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.