welcome Alex,
I've looked through the tutorial rather quick, but i might have some plans to achieve your goals.
Just to start with the easy one, album covers.
When you create a database, you could add another field, like coverSrc, containing the link to the right cover
In your HTMl, i'd create a DIV that will soon hold your album art. i would recommend giving the div a pre-defined width and height, to prevent it from resizing all the time if the size of your covers differ.
In your PHP file, you should also get that new field, and put it in a variable. let's call it $cover for eases' sake.
one of the functions in your JScript file would then have this code:
document.getElementById("yourCoverDifFieldIDhere").innerHTML = "<img src='" + $('#cover').html(string[1]) + "' />";
I didn't test this though, but maybe it gets you on the right track
Oh, and when you have a bigger database, it is probably better to use a albumID instead of an url, and then have a seperate database containing the name and cover source of the album.
If you don't plan on making this a huge application, i'd say this is unnecessary.
playing by catogory: To play by category, you'll need another field in the database called... category.
second, you'll need a dropdown list containing all the categories. make sure you only list the ones that you actually have in your database, else you would just get an error message.
I'm not exactly an expert on AJAX, but if i remember correctly it's possible to pass along information from your javascript to the PHP file.
If you can send it to your PHP file, as if it was an POST value, you can check wether that value is set, and then show a different SQL.
in PHP this'd be:
IF (isset($_POST['CAT']))
{
$song = $db->get_row("SELECT * FROM songs WHERE category=" . $_POST["cat"] . " ORDER BY RAND() LIMIT 1");
}
ELSE
{
$song = $db->get_row("SELECT * FROM songs ORDER BY RAND() LIMIT 1");
} In english if your user wanted a specific category, select a row where the category is... well, whatever the user wants :) or else execute the piece of SQL you already had.
Once again, this isn't tested.
Unfortunatly, i can't think of any easy method for repeat protection, i guess waiting for someone else to react here, or asking the author of the tutorial for help.
Sorry for the long post, and if it seems a bit confusing, teaching is not exactly my speciality :)