Dim cursor1 As ResultSet
cursor1=conA.ExecQuery2("SELECT * from credits WHERE Username=? And Password=?", Array As Object(Username, Password))
Do While cursor1.NextRow
Dim Credits As Int=cursor1.GetString("Credits")
Exist=True
Loop
cursor1.close
If Exist=False Then
resp.Write("UNKN")
Log("Unknown user")
Else
conA.ExecNonQuery2("UPDATE credits SET Credits=Credits-? WHERE Username=? And Password=?", Array As Object(BilledCredits, Username, Password))
NewCredits=Credits-BilledCredits
Dim llu As List
llu.Initialize
llu.Add(LastAccess)
llu.Add(Username)
llu.add(Password)
conA.ExecNonQuery2("INSERT INTO billings (Data, Username, Password, BilledCredits, NewCredits) VALUES (?,?,?,?,?)", Array As Object(llu))
resp.Write(NewCredits)
End If
If conA <> Null And conA.IsInitialized Then conA.Close