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.
LVL 1
NatoMasAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nanharbisonCommented:
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?
0
NatoMasAuthor Commented:
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.
0
nanharbisonCommented:
Can you tell us what part of Drupal this table is for?
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

nanharbisonCommented:
For example, if you are changing the value of a user's email, you can just go to the user's page and update it. If you give an admin the ability to make changes to the database, it could cause a huge error.
0
NatoMasAuthor Commented:
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.
0
NatoMasAuthor Commented:
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.
0
nanharbisonCommented:
Okay, I see now. There is a module which can manage your users and run reports, it's called CiviCRM, and it does a LOT of other jobs as well. It's actually like a group of modules. It's a massive module though and has a learning curve of it's own, but maybe worth looking into.
Here are some of the "real World" uses of CiviCRM:
http://book.civicrm.org/user/current/introduction/real-world-examples/
This might tell you if it does what you are looking for.
0
nanharbisonCommented:
This is NOT a module you would install without first reading the directions.
0
NatoMasAuthor Commented:
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.
0
nanharbisonCommented:
I just realized this was never solved. I don't think there is another answer for what you want to do. You would have to use PHPMyAdmin or something. And any time you put a non tech person in front of a database, you put your whole website in jeopardy of being screwed up badly. You would have to be backing up your website all the time. There is a module for that, backup and migrate. The whole Drupal site is offline while they do an upgrade, but when it is back up tomorrow, this module is here:
https://drupal.org/project/backup_migrate
0
NatoMasAuthor Commented:
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.
0
nanharbisonCommented:
Well done!
Yes, using PHP on a page is very dangerous, if you have the slightest error you might just get an error message instead of any content. That happened to me, I wasn't able to see any reports or run the update script. There are lots of tutorials in how to create a module.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NatoMasAuthor Commented:
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.
0
NatoMasAuthor Commented:
Still searching for the right solution. The responses provided was helpful.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.