Posted by MiguelD on November 10, 2012 at 7:39pm
I would like to make a form to search content of a table inside a sql database.
I would like to use html to make the submit button and text input.
I know how to access the table and show the values but not using a user action like using submit or search table for a guiven value (I would like to find the table information relevante to a certain value)
Can you help?
Thanks
Comments
Why not use views and exposed
Why not use views and exposed filters?
Depends on which tables you
Depends on which tables you want to access.
If you are accessing some tables of core drupal modules or contributed modules then may be you don't need to create the form but you can use views module. This module will allow you to create a block, have the form ready as exposed filters and also the data retrieval will be handled by it.
If you want to fetch data from custom tables(tables created by your own module) then you may create a views handler of own to use views else you need to add hook_menu and on submit redirect or ajax to that menu and handle everything in the custom module code.
Hth,
Sadashiv.
Thanks
Thanks.
But there is any example using html?
With best regards
Please visit my blog: http://talesforlove.blogs.sapo.pt
You can create a simple html
You can create a simple html block by going to structure--> blocks--> Add Block
Type the entire html code their and on submit redirect to a menu url.
The menu_url should be a hook_menu written in your own custom module and in the callback function you can write the query and handle things.
If you want something like you have the contents/blogs listed on left and you want the block on right that filters it then I will insist on using views. eg https://community.openatrium.com/documentation-en/node/15#the-case-tracker-panel (Atrium casetracker made in drupal). Using views will need less coding efforts and less time and will be easily customizable in future.
Hth,
Sadashiv
Thanks. I already instaled
Thanks.
I already instaled and will try "views".
Will try search and submit (add new information to the database)
I will tell you what I achieve.
Regards!
Please visit my blog: http://talesforlove.blogs.sapo.pt