In a project mentioned in another thread, I'm trying to get some
dynamic data to work. In this discography, you can click on an
album name, and the title of the album and its tracks will appear
on the left. I have the beginnings worked out, like so:
***
<h3><?php echo $row_rsindiv['Album']; ?></h3>
<ol>
<?php do { ?>
<li><?php echo $row_rsindiv['Song']; ?> (<?php echo $row_rsindiv
['Time']; ?>)</li>
<?php } while ($row_rsindiv = mysql_fetch_assoc($rsindiv)); ?>
</ol>
***
A sample of the database:
***
Electronic Meditation 3 Cold Smoke 10:48
Electronic Meditation 4 Ashes to Ashes 3:58
Electronic Meditation 5 Resurrection 3:21
Alpha Centauri 6 Sunrise in the Third System 4:20
Alpha Centauri 7 Fly and Collision of Comas Sola 13:23
Alpha Centauri 8 Alpha Centauri 22:04
Zeit 9 Birth of Liquid Plejades 19:52
Zeit 10 Nebulous Dawn 17:47
***
I want to tell PHP to write the album name and list the tracks in
an <li></li> based on whatever album title is clicked in the main
table.
The main table looks like:
***
<?php do { ?>
<?php
$class = ($class == 'odd') ? 'even' : 'odd';
?>
<tr class="<?php echo $class ?>">
<td><?php echo $row_rstdream['Album']; ?></td>
<td><?php echo $row_rstdream['Year']; ?></td>
<td><?php echo $row_rstdream['Era']; ?></td>
<td><?php echo $row_rstdream['Type']; ?></td>
</tr>
<?php } while ($row_rstdream = mysql_fetch_assoc($rstdream)); ?>
***
I thought maybe of changing the first <td></td> to:
<td><a href="#" onclick="<?php $album = $row_rstdream['Album'] ?>">
<?php echo $row_rstdream['Album']; ?></td>
But that's as far as I can get with my limited knowledge. Does
anyone have any ideas on how to display only the rows in the second
database that correspond to the name of the album clicked on? Sorry
the examples are so long, and I hope this makes sense.
TIA
Ian
--
http://www.bookstacks.org/