Collation issue between web page and DB

Sort of a weird problem. I had to delete my site from a server and reinstall it to fix a problem. To do this I used phpMyAdmin to backup the database I had and deleted the rest then when it was all ready, just uploaded my web pages as before (no changes) and loaded my database backup.

Yet all of a sudden I’m getting � (if you can’t see it, its a ? mark in a diamond) where the ‘£’ should be on my web pages with information that is drawn from the database.

I haven’t changed anything at all in the pages o the data itself and the only compromise I had to make when installing the DB was to remove

CREATE DATABASE `cash4aclaim` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `cash4aclaim`;

Because it wouldn’t let me create it from phpMyAdmin, had to do it from the Plesk panel.

But I went in and made sure it was set to utf-8 and utf8-general-ci. The data is also perfectly fine in the database, the £ are there.

And this is my php header.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	lang="en"
	xml:lang="en">
<head>
<meta 	http-equiv="Content-Type" 
		content="text/html; charset=utf-8"/>
        
<meta
	http-equiv="Content-Language"
	content="en"/> 

Considering I haven;t changed anything on the webpages that I’m aware of and the data in the DB is ok, I’m kind of stumped on why this is suddenly happening.

Any ideas are much appreciated.

Thanks for reading.

EDIT: If it helps, these are the set-ups for the two affected fields. As far as I can tell, everything is in order.




CREATE TABLE `blog` (
  `blog_id` int(11) NOT NULL auto_increment,
  `blog_title` varchar(150) NOT NULL,
  `blog_content` text NOT NULL,
  `blog_created` varchar(10) NOT NULL,
  `author_id` bigint(20) NOT NULL,
  PRIMARY KEY  (`blog_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;


CREATE TABLE `news` (
  `news_id` int(11) NOT NULL auto_increment,
  `news_title` varchar(150) NOT NULL,
  `news_content` text NOT NULL,
  `news_created` varchar(10) NOT NULL,
  `author_id` bigint(20) NOT NULL,
  PRIMARY KEY  (`news_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ;

EDIT2: Electric Boogaloo

Just checked my CMS and the same issue there so I think that means it is something to do with the DB

Add in your code:

$sql='set character_set_results=utf8';
mysql_query($sql);

This will control how the results will be displayed.

What method are you using to obtain the data from the database? Check out [fphp]mysql_set_charset[/fphp] over at the manual which states:-

This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES … is not recommended.

Thanks for the info guys, dunno why it did that, like I said, didn’t change anything but your tips helped. Thanks again.