Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
SELECT song_id, album
FROM abc_mp3_songs
WHERE album_id <1
GROUP BY album;
-- Besser:
SELECT DISTINCT album
FROM abc_mp3_songs
WHERE album_id <1;
SELECT
a.album,
@rownum := @rownum + 1 AS album_id
FROM
(SELECT DISTINCT album FROM abc_mp3_songs WHERE album_id = 0) AS a,
(SELECT @rownum := (SELECT MAX(album_id) FROM abc_mp3_songs)) AS vars;
UPDATE
abc_mp3_songs songs
INNER JOIN (
SELECT
a.album,
@rownum := @rownum + 1 AS album_id
FROM
(SELECT DISTINCT album FROM abc_mp3_songs WHERE album_id = 0) AS a,
(SELECT @rownum := (SELECT MAX(album_id) FROM abc_mp3_songs)) AS vars
) AS albums
ON songs.album = albums.album
SET songs.album_id = albums.album_id;
$sql = "SELECT DISTINCT album_id FROM abc_mp3_songs ";
$statement = $pdo->prepare($sql);
$statement->execute();
$num_rows = $statement->rowCount();
$data = $statement->fetchAll();
if ($num_rows > 0 && $data > 0) {
foreach($data as $row){
$sql_2 = "SELECT album_id FROM abc_mp3_songs WHERE album_id = '".$row['album_id']."' ";
$statement_2 = $pdo->prepare($sql_2);
$statement_2->execute();
$num_rows_2 = $statement_2->rowCount();
$sql_3 = "UPDATE abc_mp3_songs SET anzahl_mp3 = '".$num_rows_2."' WHERE album_id = '".$row['album_id']."'";
$statement_3 = $pdo->prepare($sql_3);
$statement_3->execute();
}//foreach($data as $row){
}