I just wrote one. Of course, for the sake of data security, I need to filter out a SQL keyword and some tables in the system. A guy who doesn’t know anything insisted on asking me for a SQL query.
I just wrote one. Of course, for data security, I have to filter out a SQL keyword and some tables in the system.
Oh, by the way, you may not know where some of the functions in it come from. They are a small framework I wrote that I use all the time when developing some things.
Encapsulate commonly used functions. Writing programs is mainly about ideas. You will know my principle after looking at the code ideas.
<%
function QuerySql(sql)
%>
<table width=680 cellspacing=1 cellpadding=3 border=0 bgcolor=#c7c7c7 align=center>
<%
set rs=getRs(sql)
FieldsNum=rs.Fields.Count
puts <tr>
for i=0 to FieldsNum-1
puts <td style=background:#ccc>&rs.Fields.item(i).name</td>
next
puts </tr>
do while not rs.eof
puts <tr>
for i=0 to FieldsNum-1
puts <td>&rs(i)</td>
next
puts </tr>
rs.movenext
loop
%>
</table>
<%
end function
%>