Hi all,

I have a header "block" that I created that I would like to use in another site (Vanilla forum) and by simply cutting and pasting the block code into the Vanilla header, it works fine.

I would prefer, however, to only have the code in one place. I was thinking of simply writing a DB query to get the block code from the Drupal database directly. The content is in the "boxes" table, so a simple:

SELECT body FROM boxes WHERE info="Header"

should do the trick. My question is whether this would be the recommended method of extracting this information. Is there some kind of API that would be better than manually creating a DB connection and running the SQL query?

Comments

phpgirl’s picture

http://api.drupal.org/api/group/database/5

which does some abstraction for me...It doesn't, however, say what things must come before and after to prepare the query, what PHP files to include, etc.

vm’s picture

I believe you have to include bootstrap.inc in a non drupal php file

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

phpgirl’s picture

I get this error:

Call to undefined function db_query_range()

vm’s picture

I'd hop in IRC to #drupal-support or #drupal

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )