DarkMetroid Posted September 6, 2007 Share Posted September 6, 2007 Hey, I have been trying to figure out a way to basically list a certain select number of rows from a database using moo.fx accordian, then list others after that, and so on, and so on till it lists all of them in a certain order. Here is my code so far... $archives = "SELECT * FROM archives WHERE active=1 ORDER BY sort ASC"; $archives_query = mysql_query($archives, $vision_content)or die(mysql_error()); $archives_num = mysql_num_rows($archives_query); $months = "SELECT * FROM archive_months WHERE active=1 ORDER BY sort DESC"; $months_query = mysql_query($months, $vision_content)or die(mysql_error()); $months_num = mysql_num_rows($months_query); . . . . . . . <div id="content"> <? while ($months_row=mysql_fetch_array($months_query)) { ?> <h3 class="toggler sec1"><a href="#sec<? echo $months_row['accordion_num']?>"><? echo $months_row['month']?> - <? echo $months_row['year']?></a></h3> <div class="accordian"> <? while ($archives_row=mysql_fetch_array($archives_query)) { ?> <p> <img src="images/<? echo $archives_row['image']?>" border="0"> <a href="<? echo $archives_row['year']?>/<? echo $archives_row['month'] ?>/<? echo $archives_row['file']?>" target="_self" class="vision"><? echo $archives_row['title']?></a> </p> <? } ?> </div> <? } ?> </div> Basically, if you guys have seen the accordion by moo.fx, I'm basically trying to get it so (from 2 tables I have in my database, one table for the 'months' and the other table for the 'contents' of each month) it will list all the contents for that certain month and then move on and list the rest of the contents for the next month and so on... I can get it to create the div tags for the main accordion with the months displayed, but I'm having trouble getting it so it will 'organize?', I guess you would say, whatever belongs on whichever month. Like I want it to only print the emails from July in the July accordion section and what not. Link if you want to see whats done so far: http://www.visionondemand.net/archive/ Any ideas of what path to go down or if this is even possible? Tried doing a JOIN, but no idea how to get that to somehow stop when its done grabbing all the content for that month... $join = "SELECT archive_months.accordion_num, archives.cat FROM archive_months, archives WHERE archive_months.accordion_num = archives.cat"; $join_query = mysql_query($join, $vision_content)or die (mysql_error()); Anyhow, Thanks. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/68256-organzing-and-listing-rows-from-database-moofx-accordion/ Share on other sites More sharing options...
DarkMetroid Posted September 7, 2007 Author Share Posted September 7, 2007 Bump. Link to comment https://forums.phpfreaks.com/topic/68256-organzing-and-listing-rows-from-database-moofx-accordion/#findComment-343369 Share on other sites More sharing options...
DarkMetroid Posted September 7, 2007 Author Share Posted September 7, 2007 Bump one more time. =( Talked to my friend, he said there is some function you can set up to basically ++ to a number that it searches for when grabbing the data. But I don't know how to control it so it grabs all the data for the number 1 before it goes on to the second number. Link to comment https://forums.phpfreaks.com/topic/68256-organzing-and-listing-rows-from-database-moofx-accordion/#findComment-343746 Share on other sites More sharing options...
DarkMetroid Posted September 7, 2007 Author Share Posted September 7, 2007 [move]bump[/move] Link to comment https://forums.phpfreaks.com/topic/68256-organzing-and-listing-rows-from-database-moofx-accordion/#findComment-344017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.