English > Development
PK's MovieDB dynamic website template
blue334:
My first thought would be that the database table is not empty, thus giving a duplicate error. But if you're sure it contains no data could you post a couple of lines from the sql file? Maybe I can spot something wrong.
You could also try to run just a couple of lines from the sql file, to narrow down the problem.
ruffa:
I removed the database, created a fresh one and i get the same error, here it is below:
******************************************************
--- Quote ---Error
SQL query:
INSERT INTO movies( NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME )
VALUES (
'0', '', '', '', '', '2008-05-29', '', '0', '', '150 YEARS OF INDIANS IN JAMAICA', '', '', '', 'JA', '', '0', '0', '', '', 'A discussion and re-enactment of the coming of the East Indians to Jamaica.', '', '', '', '', '', '', '', '', '', '0', '0', '', ''
);
MySQL said:
#1062 - Duplicate entry '0' for key 1
--- End quote ---
*************************************************
It couldn;t be refering to a duplicate film entry could it?? as i may have some duplicate titles in there.
Here is a sample of a few lines from the SQL file i exported from PVD:
--- Quote ---INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-08-06', '', '7.4', 'Amandla! A Revolution in Four Part Harmony', 'Amandla', '', 'Lee Hirsch', 'Johnathan Dorfman, Temple Fennell, Lee Hirsch, Desireé Markgraaff, Sherry Simpson', 'South Africa, USA', 'Documentary, Music, History', '2002', '108', 'Walter Cronkite, F.W. de Klerk, Abdullah Ibrahim, Jesse Jackson, Duma Ka Ndlovu, Ronnie Kasrils, Sibongile Khumalo, Vusi Mahlasela, Miriam Makeba, Nelson Mandela, Winnie Mandela, Hugh Masekela, Sophie Mgcina, Thandi Modise, Sifiso Ntuli, Sibusiso Nxumalo, Dolly Rathebe, Hendrik Frensch Verwoerd, Lindiwe Zulu', 'http://www.imdb.com/title/tt0303297/', 'Through a chronological history of the South African liberation struggle, this documentary cites examples of the way that music was used in the fight for freedom. Songs united those who were being oppressed and gave those fighting a way to express their plight. The music consoled those incarcerated, and created an effective underground form of communication inside the prisons.', '', '', '', '', '', '', '0', '', '', '0', '0', '2008-07-19', 'image83.jpg');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-08-06', '', '0', '', 'Amandla - Wake Up and Live (Bob Marley)', '', '', '', 'USA', '', '0', '0', '', '', '', 'Havard Stadium, boston, 21st July 1979', '', '', '', '', '', '0', '', '', '0', '0', '2008-07-19', 'image84.jpg');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-09-05', '', '0', '', 'Amazing World - Jamaica', '', '', '', '', '', '2001', '0', '', '', 'series, one ja episode', '', '', '', '', '', '', '0', '', '', '0', '0', '', '');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-08-12', '', '0', '', 'Amish in the City - Reggae, Never Heard of the Dude', '', '', '', '', '', '2005', '60', '', 'http://www.imdb.com/find?s=tt&q=Amish%20in%20the%20City%20-%20Reggae,%20Never%20Heard%20of%20the%20Dude', 'Reality series following young Amish people as they get their first experience of the outside world. The Amish kids grapple with LA''s public transport system, attend a music concert and indulge themselves at the races. ', '', '', '', '', '', '', '0', '', '', '0', '0', '', '');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-05-29', '', '0', '', 'An Evening With Harry Belafonte', '', '', '', '', '', '2003', '57', '', '', 'Taped in Chicago in front of a live audience, Harry Belafonte was interviewed by his friend Danny Glover. The viewer will travel back in time to Mr. Belafonte''s early childhood: New York to Jamaica and back to New York, wherein he experienced racism that was life altering. His frustrations propelled him to Humanitarian causes: marching with Martin Luther King, the Free South Africa movement, and We Are The World recording session and UNICEF to name a few.', '', '', '', '', '', '', '', '', '', '0', '0', '', '');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-05-29', '', '0', '', 'Anansi', '', '', 'Fritz Baumann', '', '', '2002', '80', '', '', 'German director Fritz Baumann''s 2002 immigrant drama follows the paths of four Ghanaians as they begin a journey to Germany in the hopes of reaping the benefits of a capitalist society -- the likes of which are simply not to be found in their homeland. Things go from bad to worse for the four companions as they begin their trip by stowing away on a freighter, only to be caught by the crew a short time later. They are sent out to sea in a small raft and eventually beach on a remote coast that leads to the Sahara. After spending a number of days wandering about, they encounter a caravan that leads them to the Moroccan port of Tangiers. After a number of devastating challenges, the group finally reaches its destination -- but not without some substantial losses along the way.', '', '', '', '', '', '', '', '', '', '0', '0', '', '');
INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('0', '', '', '', '', '2008-05-29', '', '0', '', 'Anansi Fantasia', '', '', 'Shirley Thompson', 'UK', '', '1993', '7', '', '', 'One of a series of short productions made by young black film- and video-makers, a dramatisation of a Caribbean folk tale in which trickster Anansi tries to find out a young woman’s secret name, the narration is by Jamaican-born community activist, Connie Mark (1923-2007). Cast: Storyteller, Connie Mark, Anansi, Leon Hazlewood, Dora, Dollie Henry, King, Hi Ching , Missirolinkia, Lorraine Le-Blanc. Crew: Director of Photography Jeff Baynes, Gaffer Jim Lennon, Camera Assistant Tiffany Walker, Grip Martin McCullough, Sound Recordist Kim Joseph, Art Director Andrea Montag, Make-up Artist Michele Baylis, Stills Photographer Armet Francis, Catering H. E.Thompson, Production Manager Dominic DeVine, Production Supervisor Juliet McKoen, Off-Line Editor Peter Harvey, On-Line Editor Julian Bryant, Telecine Operator Dave Ludlam, Music Shirley Thompson, Music & Effects Recording Henry Thomas, Executive Producers Paul Corley, Rodney Wilson, Special Thanks to Anita Bell, Jason Glenister, Carol Jacobs, Michael Ho, Glen Laker, Bill Pretty, Richard Thompson, Greenwich Council, The Mill, SVC TV, Tattooist International Ltd., Theatre Royal, Stratford East. Produced and Directed by Shirley Thompson. For the Arts Council of Great Britain and Carlton Television. © Arts Council of Great Britain & Prime Productions 1993.', '', '', '', '', '', '', '', '', '', '0', '0', '', '');
--- End quote ---
blue334:
The problem is your database entries aren't numbered. The ID number (the first value) is assigned as the "primary key" in the database, which probably means it has to be unique. I wasn't even aware that PVD would allow duplicate IDs.
Fortunately the internal PVD database has an internal ID you can use as a replacement value. Make the change shown with red to the sql.ptm file before exporting, this should assign the internal ID number instead:
%OPTIONS%
filter="SQL Files|*.sql"
encoding="UTF8"
replace=";<->,"
replace="'<->''"
replace=""<->"
replace="#13#10<-> "
replace="#13<-> "
replace="#10<-> "
imagepath="images\"
%OPTIONS%INSERT INTO movies (NUM, CHECKED, MEDIA, MEDIATYPE, SOURCE, DATEADD, BORROWER, RATING, ORIGINALTITLE, TRANSLATEDTITLE, FORMATTEDTITLE, DIRECTOR, PRODUCER, COUNTRY, CATEGORY, YEAR, LENGTH, ACTORS, URL, DESCRIPTION, COMMENTS, VIDEOFORMAT, VIDEOBITRATE, AUDIOFORMAT, AUDIOBITRATE, RESOLUTION, FRAMERATE, LANGUAGES, SUBTITLES, FILESIZE, DISKS, VIEWDATE, PICTURENAME) VALUES ('{%value=0}', '', '{%value=47}', '', '', '{%value=17}', '', '{%value=9}', '{%value=3}', '{%value=2}', '', '{%value=53}', '{%value=56}', '{%value=45}', '{%value=44}', '{%value=5}', '{%value=19}', '{%value=52}', '{%value=8}', '{%value=15}', '{%value=16}', '{%value=23}', '{%value=24}', '{%value=43}', '{%value=25}', '{%value=21}', '{%value=22}', '{%value=48}', '{%value=49}', '{%value=26}', '{%value=29}', '{%value=33}', '{%value=63}');
I suspect the date values formatted like "21st July 1979" will end up as "0000-00-00" in the mysql database. It should be possible to fix this using regular expressions, let me know if it becomes a problem.
EDIT: forget the last part, seems the alternative date formatting I spotted is part of a descripton text and not a date field.
ruffa:
thanks,
you know on my pvd database where u have the first field for an entry where your supposed to put a ID number maybe, i have been using this field for the film title, i did this from the start without realizing, so where it says 'Original Title' this isn;t always filled in, i wonder if this will cause the problem?
I also remembered, i think i may have removed some of the fields on the pvd sql export config so i will put this back right aswell, maybe this was causing problems aswell? i'll let u know how i get on.
blue334:
Well if that is the case you can't use the data in the ID field (which correctly is the short field before "Title"). If there is information in this field you want to display on the web page, you must manually move it to the "Original Title" field (if that is what it is)
Apparently PVD allows characters to be typed in the ID field, but the export plugin accepts only numbers (which is why all your ID fields are assigned ID=0 in the exported file)
You should not remove anything from the export template unless you fully understand the structure. Each '{%value=XX}' has a counterpart database field, and they're sorted in the same order.
That means for example that the 9th database field ORIGINALTITLE corresponds to the 9th export variable '{%value=3}'. If you remove one but not the other your data will end up in the wrong fields.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version