hope the title is clear, english is not my first language.
I have a database with all my CDs so what I want to do is list the CD titles, and songs of each in one table and in another table make a link to the coresponding songbook
the following works fine
<?php while($categorydb->next_record()): ?>
<li><a href="<?echo $categorydb->Record["id"];?>/<? echo $categorydb->Record["id"] ?>.htm">
<B><? echo $categorydb->Record["categoria"] ?></B>
<?php endwhile ?>
but then it gives an error on the second part
<?php while($categorydb->next_record()): ?>
<b><? echo $categorydb->Record["categoria"] ?></B>
<?
$currentcategory = $categorydb->Record["id"];
$seriedb = new Sample;
$seriequery = "select * from cd_titulos where catid = $currentcategory order by sid";
$seriedb->query($seriequery);
?>
<ul>
<?php while($seriedb->next_record()): ?>
<li>
<a href="<?echo $seriedb->Record["catid"];?>/<? echo $seriedb->Record["sid"] ?>.zip"><? echo $seriedb->Record["alt_text"];
?></a></li><br>
<?php endwhile ?>
</ul></font></p>
unless I do not end while after the first part, but then it also loops through all the htm code which is inbetween which I do not want.
any suggestion what I can do?
how do I list diferent fields from same query
Moderator: General Moderators
- RandomEngy
- Forum Contributor
- Posts: 173
- Joined: Wed Jun 26, 2002 3:24 pm
- Contact:
Database Normalization
I would think about restructuring the database to make it faster.
I would have one table with just the CD Title and a unique key and then another table with the songs, and the unique key pointing back to the title cd it came from.
This will save disk space and speed up queries when the database gets large.
Just my opinion.
I would have one table with just the CD Title and a unique key and then another table with the songs, and the unique key pointing back to the title cd it came from.
This will save disk space and speed up queries when the database gets large.
Just my opinion.
thanks
thank you so much, I think it has todo with having to reset the query. I'll be playing aroung with it some more. Thanks for all your replys.