Home > front end >  Consult, the query results for every display four images
Consult, the query results for every display four images

Time:12-11



















<% %=wenzi & gt;





<%

Dim the rs, SQL


For I=1 to len (wenzi)

Set the rs=server. Createobject (" adodb. You ")


SQL="select * from ziku where danzi like '%" & amp; Mid (wenzi, I, 1) & amp;" "
% '
Rs. The open SQL, conn, 3, 3


% & gt;
<%


% & gt;




<%
Rs. Close
Set the rs=nothing

% & gt;
<%
Next
% & gt;








CodePudding user response:

<%
For xx=0 to rs. Recordcount - 1
If (xx + 1) mod 4=1 then
% & gt;


<%
The else
% & gt;
Image content & lt;/td>
<%
Elseif (xx + 1) mod 4=0 then
% & gt;
Image content & lt;/td>
Image content & lt;/td>
<%
End the if
Next

If the rs. Recordcount> 0 and rs. Recordcount mod 4 & lt;> 0 then
For xx=1 to 4 - (rs. Recordcount mod 4)
% & gt;
Empty content, less than four filling & lt;/td>
<%
Next
Response. Write (" & lt;/tr>" )
End the if
% & gt;
  •  Tags:  
  • ASP