php: denkaufgabe!

Fragen zu allen Themen rund ums Programmieren außerhalb von phpBB können hier gestellt werden - auch zu anderen Programmiersprachen oder Software wie Webservern und Editoren.
Antworten
TartaroZ
Mitglied
Beiträge: 3
Registriert: 27.03.2003 15:10

php: denkaufgabe!

Beitrag von TartaroZ »

Hi you developers,

please help me to MOVE A GENRE in the following table. i have a mysql-table like this ( I cannot change the table, it's not my project!!):

Code: Alles auswählen

mysql> select id, genre from genre limit 16;
+----+---------------------+
| id | genre               |
+----+---------------------+
| b  | Alternative         |
| ba | Alternative General |
| bb | Art Rock            |
| bc | Avant Rock          |
| bd | Experimental        |
| bh | Grunge              |
| bi | Indie               |
| bm | Unclassifiable      |
| bn | Crossover           |
| c  | Books & Spoken      |
| ca | Short Stories       |
| cb | Comedy              |
| cc | Musicals/Broadway   |
| cd | Poetry              |
| ce | Cabaret / Satire    |
| cf | Religion            |
+----+---------------------+
16 rows in set (0.00 sec)
that means: Alternative General, Art Rock, ... are sub-genres of the "Alternative"-genre.

i.e. i want to move the genre "Comedy" with the id "cb" to be a child of "Alternative" with the id "a".

does anybody have an idea to manage this with a few queries? the problem is, if i change the id of a genre, i have to change this genre-id in thousands of tracks and albums.

the genre-names of each sub-genre should by ordered by the alphabet ascending, so that the example would look like this:

Code: Alles auswählen

...
| b  | Alternative         |
| ba | Alternative General |
| bb | Art Rock            |
| bc | Avant Rock          |
| bd | Comedy              |
| be | Experimental        |
| bh/bf | Grunge              |
any ideas? pleas help!
mfg phil
musashi
Mitglied
Beiträge: 1585
Registriert: 04.12.2003 12:50
Wohnort: Wien
Kontaktdaten:

Beitrag von musashi »

Du kannst im deutschen Forum auch ruhig Deine Muttersprache verwenden :-)
www.dsaforum.de - DAS DSA Fanforum
TartaroZ
Mitglied
Beiträge: 3
Registriert: 27.03.2003 15:10

Beitrag von TartaroZ »

ich hab das in mehreren foren gepostet, deswegen ist es englisch!
Antworten

Zurück zu „Coding & Technik“