Hi Can you help me? I have a problem of duplication of records and am not sure how to reword the scripting. I have a business section to a site I am building that displays the categories and discriptions of the services a particular business provides from information gathered from the database. The page I am talking about is at http://www.youfindit.co.nz/business.asp?busid=12 as you can see the title is (eg: massage) is repeating down the page. How do I reword hte scripting to prevent this. Or is it how I have structured the database. Would appreciate any feedback. <% set GalConn3=Server.CreateObject("ADODB.Connection") GalConn3.Open Connect_String dim adoRs4 set adoRs4 = Server.CreateObject("ADODB.Recordset") strSQL4 = "Select DISTINCT * From businesscategories, subcategory where busid2=" & intbusID & " and businesscategories.bussubcatid=subcategory.subid " 'response.Write(strSQL4) 'response.End set adoRs4 = galConn3.Execute(strSQL4) If not adoRs4.EOF then do while not adors4.eof %> <tr> <td width="70%" class="contentsml"> <b><%=adoRs4("subcatname")%></b> </td></tr> <% set GalConn4=Server.CreateObject("ADODB.Connection") GalConn4.Open Connect_String set adoRs5 = Server.CreateObject("ADODB.Recordset") strSQL5 = "Select * From businesscategories where bussubcatid=" & adoRs4("subid") 'response.Write(strSQL5) 'response.End set adoRs5 = galConn4.Execute(strSQL5) %> <% If not adoRs5.EOF then do while not adors5.eof %> <tr><td class="contentsml" > <%=adoRs5("busservice")%></td> <td width="30%" class="contentsml" valign="top" align="right"><%=adoRs5("busprice")%> </td> </tr> <% adoRS5.Movenext LOOP adoRs5.Close set adoRs5 = nothing GalConn4.Close set Galconn4 = nothing End if %> <tr> <td HEIGHT="2" colspan="2"><SPACER TYPE="block" WIDTH="1" HEIGHT="2"></td> </tr> <tr> <td HEIGHT="1" colspan="2" bgcolor="#000000"><SPACER TYPE="block" WIDTH="1" HEIGHT="1"></td> </tr> <tr> <td HEIGHT="2" colspan="2"><SPACER TYPE="block" WIDTH="1" HEIGHT="2"></td> </tr> <% adoRS4.Movenext LOOP adoRs4.Close set adoRs4 = nothing GalConn3.Close set Galconn3 = nothing End if %> Code (markup):
You should post your table structure too , i think you are using select dist * so it would look for complete unique records in all the fields.
website looks great, but read up on SQL injection: http://www.unixwiz.net/techtips/sql-injection.html as for your original problem, i can't see it. massage is repeated but for different session times. all seperate database entries by the looks of it.