special4mysql
IS-IT--Management
I have a mySQL database which will store some special characters (á é í ó ú ñ). My problem is that the query I am using to populate the tables is not getting the charactes stored correctly in the tables:
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`Category_ID` int(11) NOT NULL auto_increment,
`List_Order` double(11,2) default '0.00',
`Category_Name` varchar(75) NOT NULL,
`Category_Name_En` varchar(75) default NULL,
`Category_Available` tinyint(1) default '0',
PRIMARY KEY (`Category_ID`),
KEY `Category_Available` (`Category_Available`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table categories
#
INSERT INTO `categories` VALUES (2,0,'Ciencias','Science',1);
INSERT INTO `categories` VALUES (3,0,'Economía','Economy',1);
INSERT INTO `categories` VALUES (9,0,'Artes','Arts',1);
INSERT INTO `categories` VALUES (19,0,'Historia y Arqueología','History and Archaeology',1);
INSERT INTO `categories` VALUES (34,0,'Deportes','Sports',1);
INSERT INTO `categories` VALUES (35,0,'Población y Sociedad','Population and Society',1);
INSERT INTO `categories` VALUES (36,0,'Ambiente','Environment',1);
INSERT INTO `categories` VALUES (37,0,'Lengua y Literatura','Language and Literature',1);
INSERT INTO `categories` VALUES (38,0,'Municipios','Municipalities',1);
INSERT INTO `categories` VALUES (39,0,'Educación','Education',1);
INSERT INTO `categories` VALUES (40,0,'Diáspora puertorriqueña','Puerto Rican Diaspora',1);
INSERT INTO `categories` VALUES (41,0,'Religión','Religion',1);
INSERT INTO `categories` VALUES (42,0,'Gobierno','Government',1);
INSERT INTO `categories` VALUES (43,0,'Medios de comunicación','Media',1);
INSERT INTO `categories` VALUES (44,0,'Folclore','Folklore',1);
INSERT INTO `categories` VALUES (45,10,'Proyectos FPH','PHF Projects',1);
If I enter the values individually using phpMyAdmin SQL interface, the values are stored correctly, but the output on the web page is wrong. At least I would like to know how to store these special characters correctly. Is the syntax wrong?
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`Category_ID` int(11) NOT NULL auto_increment,
`List_Order` double(11,2) default '0.00',
`Category_Name` varchar(75) NOT NULL,
`Category_Name_En` varchar(75) default NULL,
`Category_Available` tinyint(1) default '0',
PRIMARY KEY (`Category_ID`),
KEY `Category_Available` (`Category_Available`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
#
# Dumping data for table categories
#
INSERT INTO `categories` VALUES (2,0,'Ciencias','Science',1);
INSERT INTO `categories` VALUES (3,0,'Economía','Economy',1);
INSERT INTO `categories` VALUES (9,0,'Artes','Arts',1);
INSERT INTO `categories` VALUES (19,0,'Historia y Arqueología','History and Archaeology',1);
INSERT INTO `categories` VALUES (34,0,'Deportes','Sports',1);
INSERT INTO `categories` VALUES (35,0,'Población y Sociedad','Population and Society',1);
INSERT INTO `categories` VALUES (36,0,'Ambiente','Environment',1);
INSERT INTO `categories` VALUES (37,0,'Lengua y Literatura','Language and Literature',1);
INSERT INTO `categories` VALUES (38,0,'Municipios','Municipalities',1);
INSERT INTO `categories` VALUES (39,0,'Educación','Education',1);
INSERT INTO `categories` VALUES (40,0,'Diáspora puertorriqueña','Puerto Rican Diaspora',1);
INSERT INTO `categories` VALUES (41,0,'Religión','Religion',1);
INSERT INTO `categories` VALUES (42,0,'Gobierno','Government',1);
INSERT INTO `categories` VALUES (43,0,'Medios de comunicación','Media',1);
INSERT INTO `categories` VALUES (44,0,'Folclore','Folklore',1);
INSERT INTO `categories` VALUES (45,10,'Proyectos FPH','PHF Projects',1);
If I enter the values individually using phpMyAdmin SQL interface, the values are stored correctly, but the output on the web page is wrong. At least I would like to know how to store these special characters correctly. Is the syntax wrong?