asp classic - Loop through SQL results and do a IF, ELSE -


i have select, like:

select item, group, paid table group=120 

the result be:

item    group    paid       120      1 b       120      1 c       120      1 d       120      0 

i need loop through result , check if itens have paid = 1 something, instead, thing. thanks.

this have:

<%           set lista= mssql.execute("select item, group, paid table group=120")         while not lista.eof         paid= lista("paid")             if paid= 1                 response.write "1"             else                 response.write "0"                   end if         loop %> 

try this:

set lista= mssql.execute("select item, group, paid table group=120") lista.filter = "paid = 0" if (lista.eof) response.write("0") else response.write("1") end if 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -