1

I have a database (MySQL) with information about food.

It has several columns, for example:

-----------------------------------------
| product name | calories | fat | unit  |
-----------------------------------------
| bread        | 100      | 10  | grams |
| potatoes     |  50      | 20  | grams |
-----------------------------------------

Is there anyway way to import this dataset into Drupal and work with it in a field type, perhaps with taxonomy? Or should I program my own module?

2 Answers 2

1

Here is a module that will help you: http://drupal.org/project/data

[ edit re MPD suggestion below ...]

This module will help by providing an automatic Views integration for your data, meaning that you can show the data via Views.

It also includes an API which simplifies custom programming to get access to your data (perhaps for use in preprocess functions, which would permit the data to be themed on a node page, etc.)

Regarding your desire to include taxonomy, one way to do that would be to fold the data onto a node and then attach taxonomy to that node, however, that might depend on how you're mapping your data onto individual nodes.

4
  • Can you describe Ho this will help?
    – mpdonadio
    Apr 26, 2013 at 0:07
  • I checked that module, and it seems very promising it is also causing a lot of errors. If anyone has an alternative suggestions I am all open for it :) Apr 26, 2013 at 5:31
  • Data would provide you CRUD of your table. Forena is just reporting.
    – Brady
    Jul 29, 2015 at 14:12
  • I just tried out Data on Simplytest.me with no issues.
    – Brady
    Jul 29, 2015 at 14:27
0

Module Forena can be used to query (not update) any MySQL database table.

For more details about Forena, 2 types of documentation are available:

  • Community documentation.
  • Documentation that comes with Forena, which you can access right after install and enable of the module. Checkout the demo site for an online example of the current:

    • Forena documentation - use the link 'Reporting documentation' or visit relative link /reports/help.
    • Forena samples - use the link 'Reporting samples' or visit relative link /reports/samples (these samples are fully functional, so make sure to experiment a bit with it, such as the drill downs available on the SVG Graph sample).

Disclosure: I'm a co-maintainer of this module,
I hope this does not violate the site's policy on self-promotion.

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.