Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

mysql encoding issue - arrrgh

  • 23-08-2011 09:55AM
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    Hi there,

    im trying to save french characters into a mysql database via php.

    for example Rhône-Alpes becomes Rhône-Alpes

    This is my create table script - everything is utf8 so what is wrong ? Thanks alot !

    
    CREATE TABLE `inscriptions_copy` (
      `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
      `nom` varchar(30) CHARACTER SET utf8 DEFAULT NULL,
      `prenom` varchar(30) CHARACTER SET utf8 DEFAULT NULL,
      `pro` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
      `sexe` varchar(1) CHARACTER SET latin1 NOT NULL DEFAULT 'M',
      `dob` date NOT NULL,
      `addy` varchar(200) CHARACTER SET utf8 NOT NULL DEFAULT '',
      `cp` int(5) NOT NULL,
      `ville` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '',
      `email` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '',
      `telp` varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT '',
      `message` text CHARACTER SET utf8 NOT NULL,
      `ip` varchar(50) CHARACTER SET utf8 DEFAULT NULL,
      `added` datetime NOT NULL,
      `already` tinyint(1) NOT NULL DEFAULT '0',
      `dispo` varchar(20) CHARACTER SET latin1 NOT NULL DEFAULT '',
      `cand` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    
    
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 3,766 ✭✭✭Reku


    At a guess the problem is that your PHP engine is using a different charset and so the values get screwed up on entry to the tables, I've had this problem before myself and had to change the PHP settings to fix it.


Advertisement