problem with displaying values
Posted: Sat Oct 23, 2004 6:14 am
Hello everybody!
I have a problem. I'm trying to build a discography site. I have MySQL database with 3 tables: disco_albums(aid, name, cover_url, released, producers, additional_info, type['album', 'single', 'video'], cds['1', '2', '3']), disco_songs(lid, aid, song_name, song_length, on_cd['1', '2', '3']) and lyrics(lsid, song_name, song_lyrics). In admin mode, admins can insert new albums. When the album is inserted, admin must select how many cds this album have. and then insert song names. Then PHP inserts song information into disco_songs table. And starts to check if the song already exists in lyrics table. If song already exists with lyrics then album insertion is complete, otherwise redirecting to page where is the <textarea> and admin can insert lyrics. And this is the spot, where my problem is.
Here's my script:
How can I display those values which are'nt in lyrics table?
If you don't understand something. Please ask...
I have a problem. I'm trying to build a discography site. I have MySQL database with 3 tables: disco_albums(aid, name, cover_url, released, producers, additional_info, type['album', 'single', 'video'], cds['1', '2', '3']), disco_songs(lid, aid, song_name, song_length, on_cd['1', '2', '3']) and lyrics(lsid, song_name, song_lyrics). In admin mode, admins can insert new albums. When the album is inserted, admin must select how many cds this album have. and then insert song names. Then PHP inserts song information into disco_songs table. And starts to check if the song already exists in lyrics table. If song already exists with lyrics then album insertion is complete, otherwise redirecting to page where is the <textarea> and admin can insert lyrics. And this is the spot, where my problem is.
Here's my script:
Code: Select all
<?php
// from here is the problem
$taking_all_lyrics = mysql_query("SELECT * FROM lyrics");
$found = mysql_num_rows($taking_all_lyrics);
if($found != 0) {
$songs = mysql_fetch_array($taking_all_lyrics);
if (!in_array($song_name1[$x], $songs)) {
echo "show songs and insert lyrics, which are not in database";
} else {
echo "end of inserting album";
}
} else {
echo "table is empty, insert lyrics for all songs";
}
// to here
}
}
?>If you don't understand something. Please ask...