Jump to content

Recommended Posts

this is an extract of my mysql table...

CREATE TABLE IF NOT EXISTS `table` (
  `id` int(25) NOT NULL auto_increment,
  `additionalInfo` text NOT NULL,
  `cost` varchar(100) NOT NULL,
  `admin_reply` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

the fields that are not showing the £ sign are 'cost' and 'admin_reply'

ok i now got it to store in the mysql as a £ not the A£ using the following method..

 

placing

mysql_query("SET NAMES 'utf8'");

just below the call to mysql_select_db();

 

but still in the email text it shows as A£

 

the data is grabbed from mysql and placed in a string as is, then placed in a $_SESSION and then once the form is sumitted the new page formats the email text using strings and this is added to the email html, again none of these strings that have the £ are altered in anyway.

Same thing:

mysql_set_charset('utf-8') == mysql_query("SET NAMES 'utf8'")

 

php recommends mysql_set_charset over mysql_query("SET NAMES 'utf8'")

 

when you pull the data out of the database, I don't think you want to use mysql_set_charset over mysql_query("SET NAMES 'utf8'"). I believe I had that problem once, by removing that, it came out normal (it may have been vise versa but I don't think so).

so when i insert i use

mysql_set_charset('utf-8');

 

and when i grab i do not use the above ?

 

that is going to be really hard to do as the connection.inc file is in every file that uses a database connection !

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.