By roodani on
Hello guys
i am a beginner in drupal and i am in the process of creating a database and i want to perform a certain queries to this db using let's say a search box in my site
so i just need guys a tuto or at least what do i have to do so i don't keep up studying unrelated stuff
thx in advance
Comments
With Drupal you do not create
With Drupal you do not create a database. Depending on the functional need, using a content type may be appropriate.
ok i am sorry may be my
ok i am sorry may be my question was a bit un-explaning
what i meant i need to know how can i make a connection when i press a button to show a certain querry of my database
Instead of trying to write
Instead of trying to write code, it is in my opinion better to learn what Drupal has to offer from core and contributed modules.
=-=
if you are trying to build a search, look at the core search module.
Things to lookup
Sounds to me like what you want is a form. To do this "The Drupal way", you want to look at the FAPI and the Database abstraction Layer.
references:
hook_menu
hook_block_info
hook_block_view
a very simple 'user search' module might look like this (without the closing ?> tag, see Developing modules for details)
## This is untested, so probably will need some adjustment to work and as is the form wont put anything to page. but designed as a point of reference more than anything
The above is something to go on for a simple form, with a query to get data. it doesn't output anything to screen, but i'm sure that should be easy enough to work out :) - I haven't tested it so it might need a bit of adjustment
Shout if you need a hand
RTFM!
For further support or projects contact me.
Source Control - Web Design, Development and Hosting Oxfordshire, UK