Hi all,
Is there a drupal module with which I can create and populate a database?For example to create a database of FOOD and populate it with my own data?

Comments

dorien’s picture

Can you elaborate on your question. Do you want to auto-create nodes or fill an external database?

polarsky’s picture

Hi dorien,
The situation is that I'm working on a module which requires external databases setup in order for it to work..more or less there will be queries to those databases by parts of the module.I thought of defining them in the hook_schema of the .install file but the data is just too much and that will be very time-consuming( cos I'll have to be writing code for the various operations on the databases before manually populate the databases)...and most of all I don't want to believe that is the only way of achieving this in drupal.
Cheers.

nevets’s picture

I would recommend looking at the Content Construction Kit (CCK) which allows you to make custom content types. So lets assume you make a food content type, it would represent one record in the database. You can use the views module to presents lists of food in various ways. There are also modules that deal with importing existing data.

polarsky’s picture

Hi nevets,
I'm afraid I may not have described the problem sufficiently. I'm working on a module that needs data in external databases.....parts of the module query these databases.So the issue is a means of creating or setting up external databases to support the module and not creating content. Thanks for your previous response.I'd appreciate any help in getting this situation fixed.
Cheers.

tryitonce’s picture

Step 1:

  1. Download and install module Node import 6.x-1.0-rc http://drupal.org/project/node_import
  2. read the bumpf

Step 2:

  1. Create Content Type "Food"
  2. add CCK Fields as needed

Step 3:

  1. do this with just five or so lines for testing first
  2. Create / move the data you have into an Excel Spreadsheet - or similar s.ware
  3. write the CCK labels across the top row and cover the columns you need
  4. insert the data you have row by row
  5. each row will become one node later

Step 4:

  1. add two columns to the front or back of the Excel Sheet - Title and Author (not sure Title might be enough - I added both)
  2. fill in the title for each node - you could use any of the fields from your data or create a formula to combine fields - you can add tokens here
  3. fill in the author ("cook" - or whatever - I think you can leave it blank and the user processing this will become the author or you choose one during the import process- the user has to exist).

Step 5:

  1. when it all works compile the Excel sheet with all the records you have
  2. save as csv or tsv and be sure to use the right conversion if you use non-standard charackters - ü, ä, etc. - test this especially before you populate the spreadsheet with all those records - if such charackters are essential
  3. now import the lot and you are almost done.

Step 6:

  1. create a View in table format to list your records in the databse format you like
  2. add Calc View if you need to show averages, totals, counts, etc.

I hope this helps - I just imported more than 5200 "buildings" into a site - you can even add images - if you work out the process of uploading them into the right directory beforehand via FTP - just a matter of testing it.

So, not just one moduel - but a process involving one great module and some VBA and macros in Excel / Word.

Good luck