Kizzume Posted December 6, 2009 Share Posted December 6, 2009 I have a forum in which I'm tired of people complaining to me about getting php errors when they type certain characters. I tried really hard to make changes so it wouldn't return the error, and now I can preview messages just fine, but I can't actually post anything at all now. phpMyAdmin - 2.11.9.5 I've been told by people that I need to type mysql_query("SET NAMES 'utf8'"); as a query. I assume that THIS would be the place where I would type a query: But when I do, I get: When I did some searching on this forum about utf8, I saw lines and lines and lines of "query code" and was overwhelmed to the point of shaking. Initially I had went through and individually changed latin1_swedish_ci to utf8_unicode_ci... But then when I went to check the main page, it showed this: And I was unable to find any way to change those entries from latin1_swedish_ci to utf8_unicode_ci. Then someone told me about mysql_query("SET NAMES 'utf8'"); Which, as I stated earlier, doesn't work, it returns an error message. Is there some easy way to change this to utf8, or is it a long process that I should probably look into paying someone to make changes to my forum? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 6, 2009 Share Posted December 6, 2009 It's a PHP instruction, not MySQL's. You need to add it to your script, where it connects to database. Quote Link to comment Share on other sites More sharing options...
Kizzume Posted December 6, 2009 Author Share Posted December 6, 2009 It's a PHP instruction, not MySQL's. You need to add it to your script, where it connects to database. Where would that script be located? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 6, 2009 Share Posted December 6, 2009 Ummm. Which version of phpbb are you using, because phpBB3 supports UTF8 natively. Perhaps it is time to upgrade... Quote Link to comment Share on other sites More sharing options...
Kizzume Posted December 6, 2009 Author Share Posted December 6, 2009 Ummm. Which version of phpbb are you using, because phpBB3 supports UTF8 natively. Perhaps it is time to upgrade... I'm using phpBB3. I found some of the settings I had seen people talk about on the forum in my config.php file, but when I put mysql_query("SET NAMES 'utf8'"); into it, it puts a whole bunch of error messages on the forum at the top of the screen when I go to it.... When I make it: mysql_query("SET NAMES 'utf8'", $conn); it puts THIS at the top of the screen when I go to my forum.... Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/kizzum5/public_html/forum/config.php on line 14 [phpBB Debug] PHP Notice: in file /includes/functions.php on line 3973: Cannot modify header information - headers already sent by (output started at /config.php:14) Quote Link to comment Share on other sites More sharing options...
Kizzume Posted December 6, 2009 Author Share Posted December 6, 2009 I'm still confused--would putting the right query/command in the config.php file change the database to collate using utf8? How, in general, am I supposed to change THESE entries: To utf8_unicode_ci? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 6, 2009 Share Posted December 6, 2009 I think the best place to ask these questions would be here: http://www.phpbb.com/support/forums/ Quote Link to comment Share on other sites More sharing options...
Kizzume Posted December 6, 2009 Author Share Posted December 6, 2009 I think the best place to ask these questions would be here: http://www.phpbb.com/support/forums/ Thanks.... The main thing I'm trying to figure out is how to change those values in the database from latin1_swedish_ci to utf8_unicode_ci Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 6, 2009 Share Posted December 6, 2009 Just changing the character set/collation of existing tables won't change the data in the tables, it will just make it non-displayable. Since a fresh install of phpbb3 has all the tables with the utf8 character set and collation, best guess is that you got to this point through an upgrade. You will need to do an export of your existing data, convert the data and the tables, and import the data back in to get this to work. There might be a phpbb mod or a utility to help with this, but your best bet would be to export your existing data in a format that can be imported into a new installation of phpbb3. Quote Link to comment Share on other sites More sharing options...
Kizzume Posted December 6, 2009 Author Share Posted December 6, 2009 I just went back to the way it was for now. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.