How can I display the data that is recalled from my cold fusion code below so that its is displayed in a table with two colums and twenty rows so that each row has two different results going across. I made a form to run a search of my database using the cold fusion code below. I have tried to put the results of the cold fusion query in a table but all I get is the same result repeated more than once across and the rest of query results going down the page with a copy of each next to eachother. I would like to have the results of the search to be displayed in a two column by twenty row table without having the results being displayed twice across. Really I want two differnt search results on the same row instead of having only one per row. I hear that I need to create a counter to assign numbers to each result so that they are not repeated if so how can i do this and set up this table. Thanks for your help.
Below is the code.
The code from my form.html:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form action="search9.cfm" method="post">
<input type="text" name="SearchFor" value=""> <input type="submit" value="Search For Photos By Description">
</form>
</body>
</html>
------------------------------------------------------------
The code from my search.cfm file:
<CFQUERY DATASOURCE="tjg" NAME="gwpr">
Select FileName,Description
From gwpr WHERE Description LIKE '%#form.SearchFor#%'
ORDER BY FileName
</CFQUERY>
<CFIF gwpr.Recordcount GTE "1">
<table width="850" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center">
<p><font size="+3" face="Arial"><i><font color="navy">Search Results for
<cfoutput>#form.SearchFor#</cfoutput>...</font></i></font> </p>
<p> </p>
</td>
</tr>
<br>
<CFOUTPUT QUERY="gwpr">
<tr>
<td align="center">
<p><img src="photopages/photos/#FileName#"> <br>
#Description#</p>
<p> </p>
</td>
</tr>
</CFOUTPUT>
</table>
<cfelse>
<BR><BR><BR>
<cfoutput>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<font face="arial" size="+2" color="green">Sorry, your
search for #SearchFor# returned no results... Please Search for something
else!</font>
</td>
</tr>
</table>
</cfoutput>
<BR><BR><BR>
</cfif>
Below is the code.
The code from my form.html:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form action="search9.cfm" method="post">
<input type="text" name="SearchFor" value=""> <input type="submit" value="Search For Photos By Description">
</form>
</body>
</html>
------------------------------------------------------------
The code from my search.cfm file:
<CFQUERY DATASOURCE="tjg" NAME="gwpr">
Select FileName,Description
From gwpr WHERE Description LIKE '%#form.SearchFor#%'
ORDER BY FileName
</CFQUERY>
<CFIF gwpr.Recordcount GTE "1">
<table width="850" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center">
<p><font size="+3" face="Arial"><i><font color="navy">Search Results for
<cfoutput>#form.SearchFor#</cfoutput>...</font></i></font> </p>
<p> </p>
</td>
</tr>
<br>
<CFOUTPUT QUERY="gwpr">
<tr>
<td align="center">
<p><img src="photopages/photos/#FileName#"> <br>
#Description#</p>
<p> </p>
</td>
</tr>
</CFOUTPUT>
</table>
<cfelse>
<BR><BR><BR>
<cfoutput>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<font face="arial" size="+2" color="green">Sorry, your
search for #SearchFor# returned no results... Please Search for something
else!</font>
</td>
</tr>
</table>
</cfoutput>
<BR><BR><BR>
</cfif>