troubleshooting Question

EASY: Module that reads data from a custom table

Avatar of Emanuele_Ciriachi
Emanuele_Ciriachi asked on
DrupalWeb FrameworksContent Management
7 Comments1 Solution468 ViewsLast Modified:
I am a drupal beginner (read and completed the first two tutorials on module development), and would like to know more about DB access.

Let's say, for sake of example, that I want to create a module that sorts recipes according to page and recipe number; to this extent I create, inside the drupal DB, a table called "recipes".

Can I query this table directly with drupal functions? And if yes, how? Does it has to follow the table naming conventions of the other tables (prefix, ecc.)?

I would greatly appreciate if someone could write a sample meta-code on how to get, say, recipe_text and recipe_difficulty fields from a fictional "recipes" table.
ASKER CERTIFIED SOLUTION
Ultrus

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros