Hi,
ich habe mir eine Anleitung besorgt, wie man Datagrid erzeugt. Ich hoffe, dass
ich mit diesem Artikel etwas weiter komme in Sachen PHP/MySQL... Dummerweise
hat sich gleich zu Anfang ein Problem ergeben und zwar bei der
Generierung der DB. Ich bekomme immer Fehlermeldungen und kann leider nicht
wirklich nachvollziehen, woran das liegen könnte. Ich benutze phpMyAdmin
2.6.0 und MySQL 3.23.49
#1064 - You have an error in your SQL syntax near '
PRIMARY KEY (`GENRE_ID`))
TYPE=MyISAM AUTO_INCREMENT=4' at line 1
Hier der dazugehörige SQL-Code. Ist für einen Pro wahrscheinlich kein riesen
Ding, deshalb würde ich mich freuen, wenn mir jemand sagen könnte, was
daran nicht stimmt.
Code:
CREATE TABLE `genres` (`GENRE_ID` tinyint(4) NOT NULL auto_increment,`GENRE_NAME` varchar(100) NOT NULL default ‘‘,
PRIMARY KEY (`GENRE_ID`))
TYPE=MyISAM AUTO_INCREMENT=4;
INSERT INTO `genres` VALUES (1, ‘Classical’);
INSERT INTO `genres` VALUES (2, ‘Rock’);
INSERT INTO `genres` VALUES (3, ‘Blues’);
CREATE TABLE `records` (
`RECORD_ID` int(11) NOT NULL auto_increment,
`TITLE` varchar(150) NOT NULL default ‘‘,
`DESCRIPTION` varchar(255) NOT NULL default ‘‘,
`PRICE` float NOT NULL default ‘0’,
`GENRE_ID` tinyint(4) NOT NULL default ‘0’,
PRIMARY KEY (`RECORD_ID`))
TYPE=MyISAM AUTO_INCREMENT=10;
#
# Dumping data for table `records`
#
INSERT INTO `records` VALUES (1, ‘Chopin: The Piano Works’, ‘The compilation of Chopin\’s best creations’, ‘94’, 1);
INSERT INTO `records` VALUES (2, ‘Bach\’s Cello Suites’, ‘These days, almost every world-class cellist has tried their hand at J.S. Bach\’s six cello suites. Here\’s a look at some favorites--from Casals\’s groundbreaking 1930s recording and Rostropovich\’s rhapsodic account to Yo-Yo Ma\’s Inspired by Bach disc.’, ‘19.45’, 1);
INSERT INTO `records` VALUES (3, ‘Beethoven: Symphonies Nos. 3 & 6’, ‘‘, ‘5.96’, 1);
INSERT INTO `records` VALUES (4, ‘Bruce Springsteen: Devils & Dust’, ‘Entire album in 5.1 channel surround sound and in 2 channel stereo.’, ‘9.95’, 2);
INSERT INTO `records` VALUES (5, ‘Sting: Bring on the Night’, ‘This album is an exceptional recording by an artist who was searching for new ways to expand his creative musical boundaries.’, ‘9.95’, 2);
INSERT INTO `records` VALUES (6, ‘The Very Best of Deep Purple’, ‘‘, ‘7.86’, 2);
INSERT INTO `records` VALUES (7, ‘The Ultimate Collection’, ‘‘, ‘8.55’, 3);
INSERT INTO `records` VALUES (8, ‘Muddy Waters: His Best: 1947 to 1955’, ‘One of the best recordings in Chess Records\’ 50th Anniverary series is the first of two bookend Muddy Waters collections’, ‘13.99’, 3);
INSERT INTO `records` VALUES (9, ‘Riding with the King’, ‘‘, ‘9.95’, 3);
thanx
Elli