Kod: Tümünü seç
<%
sayi1=request.form("sayi1")
sayi2=request.form("sayi2")
sonuc = cint(Request.Form("sayi1")) + cint(Request.Form("sayi2"))
SQLtoplamhesap=select sum(sonuc) as toplamsonuc from toplama
set hesapDB=server.createobject("ADODB.connection")
hesapDB.open "toplamahesap"
sql="insert into toplama(sayi1,sayi2,sonuc) values ('"&sayi1&"','"&sayi2&"','"&sonuc&"')"
hesapDB.execute (sql)
Set QUERY = hesapDB.Execute(SQLtoplamhesap)
toplamsonuc=(QUERY.Fields.Item("toplamsonuc").Value)
hesapDB.close
set hesapDB=nothing
response.write "Bilgileriniz Tabloya işlendi.."
Response.Write sonuc
%>
Toplam Öğrenci sayısı <%= toplamsonuc%>
alanlar:
sayi1 , sayi2 , sonuc , toplamsonuc
örnek:
...............sayi1.....sayi2.....sonuc.....toplamsonuc
1.kayit.......10........20..........30..............30
2.kayit.......10........40..........50..............80--> buraya sonuc alanın toplamını yazacak arakadaşlar kodlar yukarda ama
Kod: Tümünü seç
Sözdizimi hatası
/toplama/hesap_islem.asp, line 16, column 15
SQLtoplamhesap=select sum(sonuc) as toplamsonuc from toplama