i have issue cold fusion / mysql script. goes this... have 2 tables of info.
i have 2 tables; tbl_property , tbl_prop data. latter has data sheets relating properties in other table... below query , can tell me doing wrong!
<cfquery name="getinfobystreet" datasource="#application.dsn#"> select tbl_property.prp_street_name, tbl_property.prp_street_suffix, tbl_property.prp_street_number, tbl_property.prp_street_direction, tbl_prop_data.pd_cat, tbl_prop_data.pd_ref, tbl_prop_data.pd_action, tbl_prop_data.pd_date, tbl_prop_data.pd_pdffile, tbl_prop_data.pd_activity, tbl_prop_data.prp_id, tbl_prop_data.pd_id, tbl_prop_data.company_id, tbl_prop_data.pd_status tbl_property inner join tbl_prop_data on tbl_property.prp_id = tbl_prop_data.prp_id pd_active = 1 , pd_date >= <cfqueryparam value="#begin#" cfsqltype="cf_sql_date"> , pd_date <= <cfqueryparam value="#end#" cfsqltype="cf_sql_date"> <cfif activitys1 neq 0>and pd_activity = '#activitys1#'</cfif> <cfif references1 neq 0>and pd_ref = '#references1#'</cfif> <cfif actions1 neq 0>and pd_action = '#actions1#'</cfif> <cfif statuss1 neq 0>and pd_status = '#statuss1#'</cfif> , pd_cat = '#form.cat#' group prp_street_name asc </cfquery>
here screenshot of results it's giving me - , display code. want loop records match under grouped streets...
<cfoutput query="getinfobystreet" group="prp_street_name"> <table width="100%" border="0"> <tr> <th class="display">#prp_street_name# #prp_street_suffix#</th> <th class="display">date</th> <th class="display">reference</th> <th class="display">action</th> <th class="display">pdf</th> </tr> <cfloop query="getinfobystreet"> <tr> <td height="41">#prp_street_number# #prp_street_direction# #prp_street_name# #prp_street_suffix#</td> <td>#dateformat(pd_date, "mm/dd/yyyy")#</td> <td><span class="smallblack">#getactionnow.name#</span></td> <td><span class="smallblack">#getrefnow.name#</span></td> <td>#pd_pdffile#</td> </tr> </cfloop> </table> </cfoutput>
when using cfoutput
loop through group query use nested cfoutput
loop through group.
<cfoutput query="getinfobystreet" group="prp_street_name"> <table width="100%" border="0"> <tr> <th class="display">#prp_street_name# #prp_street_suffix#</th> <th class="display">date</th> <th class="display">reference</th> <th class="display">action</th> <th class="display">pdf</th> </tr> <cfoutput> <tr> <td height="41">#prp_street_number# #prp_street_direction# #prp_street_name# #prp_street_suffix#</td> <td>#dateformat(pd_date, "mm/dd/yyyy")#</td> <td><span class="smallblack">#getactionnow.name#</span></td> <td><span class="smallblack">#getrefnow.name#</span></td> <td>#pd_pdffile#</td> </tr> </cfoutput> </table> </cfoutput>
Comments
Post a Comment