title! Want to call the recommended product feature on the home page instead of ordering the call by Product ID, currently called from low to high, want to change to call the recommended product, code as follows
<tr> <TD height= "background=" images/l2.gif "><div class=" dd1 "> Products Center <span class=" YF ">product center</span><span class=" More ">&nbsp;&nbsp;&nbsp &nbsp;&nbsp;&nbsp;&nbsp;<img src= "Images/mor.gif" width= "7" height= "7"/>&nbsp;<a href= "products.asp" class= "Ma" > more ...</a></span></div></td> </TR > <tr> <TD height= "235" valign= "Top" background= "Images/l2.gif" > <% set Rp=server. CreateObject ("Adodb.recordset") sql= "select top 4 title,id,img from products ORDER BY id DESC" Rp.open sql,conn,1,1 If rp.eof and Rp.bof then response. Write ("") Else Do While not rp.eof %> &NBSP; <div class= "Pro" > <a href= "SHOW.ASP?ID=<%=RP (" id ")%>" ><img src= "<%=RP (" img ")%>" alt= "<%=RP (" title ")%>" width= "108" height= "" border= "0"/></a> <a href= " SHOW.ASP?ID=<%=RP ("id")%> "><%=rp (" title ")%></a></div> <% Rp.movenext loop End If rp.close &NBSP ; Set rp=nothing %> </td> </tr> Solution: First, see if you have a "recommended" setting in your background publishing product. If not, you will need to modify the database to add a "recommended" field, such as istop (for example, data type, default value 0) Product Management Department set recommendation, just modify the Istop value, such as RS ( "Istop") =1 (not 0 as a recommended product) Then at the front desk so modified sql= "select top 4 title,id,istop,img from Product ORDER by Istop Desc,id desc " The reason for the use of a by instead of a WHERE clause is to display when the recommendation is less than 4 items