0

I am new to Drupal, i have installed drupal and playing around its functionalities. I am wondering about how to create a page in drupal and write my php code to fetch some data from Drupal db.

Could anyone give me an idea about this or any example links would be helpful. In mean time, i am searching through the web to find a simple example which could help me to learn this.

FYI : I am using Drupal 7.7

Thanks

3 Answers 3

2

Nikit's answer of writing a custom module or using PHP filter is correct in that it will let you pull data from the Drupal database to manipulate it, but you should be sure that there is not a more correct "Drupal way" of doing what you need to do.

I know when I started with Drupal my main concern was finding out how to execute SQL queries, but Drupal provides a number of abstractions that let you perform many queries without needing to write any custom code.

Views, for example, lets you create very complex dynamic SQL queries to list data in various formats (HTML, XML, JSON, etc) and add-ons like Views Calc let you run dynamic transformations on this data.

Sign up to request clarification or add additional context in comments.

Comments

2
  1. Write custom module
  2. Enable PHP Filter module and create node with PHP Filter.
  3. And more and more...

Comments

0

That would depend on the kind of data you would like to retrieve but the whole idea behind Drupal is actually to reduce writing any php.

You generally add functionality by using modules, if a module doesn't exist then you could write one, in this way you not only solve a problem but also participate to the development & the community behind Drupal.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.