|
Posted by Jim Hernandez on 11/15/05 15:19
This has set me back a couple of days now and I could really use some
help or at least a shove in the right direction.
What I'm trying to do is list reviews in a database on a page, by
artist (byartist.php). The first step is pulling each artist and
listing them alphabetically. If the artist has more than one album
reviewed, they should still only show up once, so I need to check each
row of the recordset, and check the artistname against a variable or
something, and if it exists, to just skip it and move on to the next row.
Then I need to list the albums reviewed under each respective artists
name and use them as links with url parameters to the respective review
pages.
I've got the recordset down per some advice from another newsgroup, and
I'm fairly certain its correct for what I need to do.
<?php require_once('conntest.php'); ?>
<?php
mysql_select_db($database_test, $test);
$query_byartist = "select artists.artistid, artists.artistname,
areviews.albumid, areviews.atitle from artists join areviews on
artists.artistid = areviews.artistid";
$byartist = mysql_query($query_byartist, $test) or die(mysql_error());
$row_byartist = mysql_fetch_assoc($byartist);
$totalRows_byartist = mysql_num_rows($byartist);
?>
The php example I was given for pulling the results was kind of
half-effort and not enough for me to really see what was going on,
understand it and build upon it. I'm (obviously) just starting out with
php/mysql and I'm pretty good at building upon something in front of me
and figuring it out, just need a little help because I've tried it over
and over and to no avail, I wind up with syntax errors.
Sorry for the wordy post, I didnt want to skimp. Thanks for any help or
advice or any points in the right direction. I've got about 3 days of
progress to catch up on
[Back to original message]
|