Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3999572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:40:28+00:00 2026-05-20T07:40:28+00:00

now i want to display some articles title which from another forum. and put

  • 0

now i want to display some articles title which from another forum. and put the articles’ title on the page-front.tpl.php.maybe i can write the database connection and query code into the page-front.tpl.php directly. but this is too bad for efficiency. in order to get a hign efficiency. how should i do. the version of drupal is drupal 6

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:40:29+00:00Added an answer on May 20, 2026 at 7:40 am

    See http://drupal.org/node/18429 on how to connect to another database by using the provided API. Note that in D6, you can only connect to the same database type (mysql/pgsql) as your default db is.

    As googletorp already noted, you should not execute queries or do any processing inside theme functions/templates.

    You for example do it inside a hook_preprocess_page() function and then just display it in your template.

    Or even better, if that works for you, would be to write a simple module that exposes a block which you can then place wherever you want in your theme. See hook_block(). With that, Drupal can take care of the caching for you, you just need to define how it is supposed to be cached (global, per role, ..). This is all described on the linked documentation page above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display some data which comes from my db using jQuery.ajax() (i.e.
I have a simple .html page which uses Javascript to display some popups. Now
I'm a newbie with SQL... Now I want to display some instances of AddrDistances
Hey guys, I have an application that I want to display some data from
I got this Base64 gif image: R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7 Now I want to display this
I have made a java swing GUI. Now I want to display a static
I'm using MVVM in my WPF project. Now I want to display a subwindow
Hi I have created a zend_form_element_submit. Now i want to display a confirmation message
I've following Grid to display data, now when I want to add new record
I am currently coding some chat program and now want to play music via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.