1 (edited by guardian34 2006-08-06 15:01)

Topic: Can't register after switching to UTF-8

I get an error from this line:

// Check that the username (or a too similar username) is not already registered
$result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username) = UPPER(\''.$db->escape($username).'\') OR UPPER(username) = UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Unable to fetch user info ///02', __FILE__, __LINE__, $db->error());

I've changed everything to UTF-8 in MySQL, and I've added this to common_db.php:

$db->query("SET NAMES 'UTF8'");

I haven't had any other problems (or changes) since switching.

Edit: If I comment out this line, then I can register successfully.

Re: Can't register after switching to UTF-8

Enable debug mode, paste the error

3 (edited by guardian34 2006-08-17 21:09)

Re: Can't register after switching to UTF-8

File: /home/httpd/vhosts/mydomain/httpdocs/forums/register.php
Line: 113

PunBB reported: Unable to fetch user info

Database reported: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (Errno: 1267)

Re: Can't register after switching to UTF-8

Set your database collation to utf8_general_ci

Re: Can't register after switching to UTF-8

I missed that, thanks. smile

Re: Can't register after switching to UTF-8

Actually, I still get the same error.