File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -130,14 +130,14 @@ function update($id, $values) {
130130 // Does composer exist?
131131 $ cid = $ this ->doesComposerExist ($ values ["composer " ]);
132132 if ($ cid > 0 ) {
133- // YES
133+ // YES: composer exists, but is not used by another song
134+ $ query = "UPDATE composer SET name = \"" . $ values ["composer " ] . "\" WHERE id = $ cid " ;
135+ $ this ->database ->execute ($ query );
134136 $ values ["composer " ] = $ cid ;
135137 }
136138 else {
137- // NO --> update composer
138- $ query = "UPDATE composer SET name = \"" . $ values ["composer " ] . "\" WHERE id = " . $ song ["composer " ];
139- $ this ->database ->execute ($ query );
140- $ values ["composer " ] = $ song ["composer " ];
139+ // NO: composer exists and is not used by another song (obviously)
140+ $ values ["composer " ] = $ this ->createComposer ($ values ["composer " ]);
141141 }
142142 }
143143 }
You can’t perform that action at this time.
0 commit comments