Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
davellaman #1
creating a dynamic table with subcategories
Hello,
I am trying to organize videos by date and category. I want it to look like
this:
June 9th 2004
Animals
-funny cat on roof
- dog eats ice cream
General Humor
-man goes sledding
-another example here
Music Video
-music video 1
-music video 2
June 10th 2004
General Humor
-funny guy
Music Video
-music video 1
basically every time i upload a video, i want it to go under that days date
then go under that category, and if there are none for thatcategory, dont even
display "General Humor" etc..
<cfquery name="Getvideolist" datasource="*******" username="*******"
password="*******">
SELECT *
FROM Videos
where approval=1
ORDER BY date DESC
</cfquery>
<cfset MaxRows_Getvideolist=20>
<cfset
StartRow_Getvideolist=Min((PageNum_Getvideolist-1)*MaxRows_Getvideolist+1,Max(Ge
tvideolist.RecordCount,1))>
<cfset
EndRow_Getvideolist=Min(StartRow_Getvideolist+MaxR ows_Getvideolist-1,Getvideolis
t.RecordCount)>
<cfset
TotalPages_Getvideolist=Ceiling(Getvideolist.Recor dCount/MaxRows_Getvideolist)>
<table border="0">
<cfoutput
query="Getvideolist" startRow="#StartRow_Getvideolist#"
maxRows="#MaxRows_Getvideolist#">
<cfquery
name="Getvideolistcat" datasource="*******" username="*******"
password="*******">
SELECT *
FROM Videos
where approval=1 and date='#Getvideolist.date#' and
category='#Getvideolist.category#'
ORDER BY category ASC
</cfquery>
<tr>
<td><span
class="style7">#Getvideolist.date#</span></td>
<td> </td>
</tr>
<tr>
<td><ul>
<li><a
href="showvideo.cfm?id=#Getvideolist.id#">#Getvide olist.Description#</a></li>
</ul></td>
<td><strong><em>#Getvideolistcat.category#</em></strong></td>
</tr>
<tr>
<td><div
align="right"><span class="style6">thanks #Getvideolist.name#</span></div></td>
<td> </td>
</tr>
</cfoutput>
</table>
that is my code as of right now, and it it looping it and displaying the dates
but it is doing it individually
here is the link to view the current output:
[url]http://www.shockworthy.com/videos.cfm[/url]
as you can see it display the videos, however, it does not organize them
accordingly, "sports" do not fall under one sports title and the dates are
displayed for each video...any ideas?
thanks
mark
davellaman Guest
-
creating dynamic table in oracle
Here is the bit causing problems: create table tempTAble (case_id) as SELECT case_id from feedback where feedback.status=1 Its giveing me the... -
Product Categories & Subcategories
I want to create a category menu that allows any number of levels of subcategories, that is, you can have a parent category and that category can... -
[PHP] Subcategories in php
I'd use the parent category id as a hidden field in the form when adding a sub category. Here is a complete script that contains all the code you... -
How to create a table with dynamic table name
<html><div style='background-color:'><DIV> <DIV class=Section1> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman"... -
Dynamic Table with Dynamic LinkButtons
Looks like I'm not the only one to come across this. Found a post 9 months old that deals with the same thing. Here's the fix: Add line:...



Reply With Quote

