Jump to content
#StayAtHome ×

Archived

This topic is now archived and is closed to further replies.

Kizzume

[phpBB3]SQL Noob here, trying to change my forum to utf8....

Recommended Posts

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:

 

noob.gif

 

But when I do, I get:

 

noob3.gif

 

 

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...

 

myphpadmin2.gif

 

But then when I went to check the main page, it showed this:

 

unicode.gif

 

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?

Share this post


Link to post
Share on other sites

It's a PHP instruction, not MySQL's. You need to add it to your script, where it connects to database.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Ummm. Which version of phpbb are you using, because phpBB3 supports UTF8 natively. Perhaps it is time to upgrade...

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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:

 

unicode.gif

 

To utf8_unicode_ci?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • 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.