Link to home
Start Free TrialLog in
Avatar of NatoMas
NatoMas

asked on

Drupal 7 - View/Edit database table fields

Hi,

I'm currently working on a Drupal 7 website and would like to figure out how to view and update a value for a specific field in a database table.  I'm looking for a module or some type of customize code that can do this.  The table will be manage by a
Admin with limited technical skills, so the procedures needs to be easy. So I was thinking of something like a custom module or Drupal page that will allow the Admin to simply search the table with filters. After the query display the result, the Admin will then have the option to change the field values to a single or multiple records (bulk update).

Thanks in advance.
Avatar of nanharbison
nanharbison
Flag of United States of America image

Can you tell us where in the database this table is? Is it part of Drupal or a separate unrelated table perhaps in a different database?
Avatar of NatoMas
NatoMas

ASKER

Hi Nanharbison,

Thanks for the quick reply. The table is not a separate unrelated table, its part of the Drupal database that was created initially with the website.

Not sure if this is feasible, but the objectives I would like to achieve are:

1) Develop a module to retrieve data from the database and display result. GUI friendly.
2) Data entry feature for updating the field values of records return. Text box entry, droplist, etc.
3) Some type of Bulk update checkbox feature (Select All).
4) Save and update button, then return update result a report will be nice.
Can you tell us what part of Drupal this table is for?
SOLUTION
Avatar of nanharbison
nanharbison
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NatoMas

ASKER

Nanharbison,

Lets see if I can answer your question about the table. This table is associated to the users table. Some of the fields in this table seems to be attached to the user ID. For example, in phpAdmin I could see the field user id is defined as entity_id which is similar to the UID in the user table.

Hopefully, this make sense...sorry for my lack of knowledge.

Also this field I'm trying to update is defined in the user account profile.
Avatar of NatoMas

ASKER

I can change the value of the field that is defined in the user account setting. However, I would like to make a separate module or page that will allow a admin to query, then the ability to update the value from the return display result. For example, query all user that that have past due membership fee base on date  -> display result: user, age, and date -> ability to update the date by entering each records one by one or also have the option to update all records with the same paid date.

Core objective I'm trying to accomplish - a page that allow a user with permission to query the database, display the result as content to a page, and edit the field from the the result query.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is NOT a module you would install without first reading the directions.
Avatar of NatoMas

ASKER

Thanks Nanharbison, I can see why this module can be useful. However, this module has too many features and seems to convoluted for what I'm trying to accomplish.

Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NatoMas

ASKER

Thanks for following up Nanharbison.

I figured it out how to access the database using db_query. I created a php content page in Drupal to test it. It worked and was able to displayed the fields I need. Now I need to figure out how to convert the raw data to readable format like the date, and 0 1 data value to boolean value or string value. I still need to figure out the codes to update the field value from the php page either using key entry, drop down list, or checkbox.  

Also creating it in a php page is probably the incorrect way of doing this so I'm sure I figured this out, I will have to break up the codes and set it up as a module.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NatoMas

ASKER

Thanks for your all your quick reponses Naharbison.  You're awesome!

I'm sure there's more ways to approach this then creating a php page. I'll look into moving the concept as a module.
Avatar of NatoMas

ASKER

Still searching for the right solution. The responses provided was helpful.