Drupal 7/Adding data in custom tables

asked Oct 23, 2013 in Website Builder by carebare (1,420 points)
I want to create a form and then save the form’s data into my Drupal 7 database custom tables. Is this possible ? and if so, how can I do it?
Any help on this will be highly appreciated
Many thanks in advanced

1 Answer

0 like 0 dislike
answered Oct 23, 2013 by RalphK (5,800 points)
This is possible.
1. You will first have to create a customized module and then create the database tables inside a .install file. You can do this using hook_schema.
2. Now, in your .module file, make your own form that will save the entered values to your tables in the submit function. The bellow links will explain more about this
https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_schema/7 https://api.drupal.org/api/drupal/includes%21form.inc/group/form_api/7