Web Hosting Talk







View Full Version : echo MySQL data into page title


LP560
08-11-2009, 11:17 AM
I've been stuck on this for months, not sure what I'm doing wrong or even if it can be done.

At the moment my sites header is in a global config file including the title tag, the first part of the title is located within this config file (so its the same on each page) the second part is in the following code on each page:

<?php echo get_header('My Title For This Page') ?>

So I end up with the following page title:
My site name | My Title For This Page

What I want to do is echo some info from my DB instead, is this possible?

Something like this:
<?php echo get_header('$heli['9']') ?>

Which would echo the info from the DB to the page title, but it doesn't want to work.

Any help will be appreciated :agree:

DesignBear
08-11-2009, 04:30 PM
You'll need to include a page that already calls your SQL table and then use that (I believe).

CreativHost
08-11-2009, 04:33 PM
If you have some PHP knowledge, this page will help you in what you are trying to achieve - ht tp://www.plus2net.com/php_tutorial/php_mysql_data_display.php

serversuperhero
08-13-2009, 10:06 AM
If you want to PM me, I will help you out.