Solved

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Posted on 2014-01-22
3
561 Views
Last Modified: 2014-01-22
I get the following warning "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' ".

CREATE TABLE `evenemang` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resanr` int(11) DEFAULT NULL,
  `datum` date NOT NULL DEFAULT '0000-00-00',
  `titel` varchar(50) DEFAULT NULL,
  `plats` varchar(50) DEFAULT NULL,
  `antal_biljetter` int(11) DEFAULT '0',
  `resa_pris` int(11) DEFAULT '0',
  `antal_frukost` int(11) DEFAULT '0',
  `frukost_pris` int(11) DEFAULT '0',
  `antal_lunch` int(11) DEFAULT '0',
  `lunch_pris` int(11) DEFAULT '0',
  `antal_middag` int(11) DEFAULT '0',
  `middag_pris` int(11) DEFAULT '0',
  `antal_vickning` int(11) DEFAULT '0',
  `vickning_pris` int(11) DEFAULT '0',
  `beskrivning` blob,
  `date` date DEFAULT NULL,
  `time` time DEFAULT NULL,
  `ip` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

boka-1-admin.php

How come?
0
Comment
Question by:lericson
  • 2
3 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
Comment Utility
Your database probably has a utf8 default charset, and you're trying to define a latin1 character set in your table. Try changing the "DEFAULT CHARSET" part of your statement to use the utf8 character set for the database.
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
Comment Utility
If your table is already created and you're getting that error during inserts / updates, then convert your table to utf8:

ALTER TABLE `evenemang` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

You may need to do this for other tables, too. I'd always recommend using utf-8 over latin1 nowadays.
0
 

Author Closing Comment

by:lericson
Comment Utility
Thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now