this usually is not a problem, but im forced to use PB's database lib and im not doing very well
i need to run a query while running a query, end the second query and carry on with the 1st, but PB wont let me
heres a code snippet, can anyone (A) see what im doing wrong, (B) tell me if its possible to do with PB's database lib
Code: Select all
; start query
If DatabaseQuery(0, "SELECT * FROM User WHERE ID="+Str(UserID))
If FirstDatabaseRow(0)
Name.s=GetDatabaseString(0,1)
Email.s=GetDatabaseString(0,2)
Notes.s=GetDatabaseString(0,3)
Ban.s=GetDatabaseString(0,4)
SetGadgetText(#Text_UserName, Name)
SetGadgetText(#Text_UserEmail, Email)
SetGadgetText(#Text_UserNotes, Notes)
FinishDatabaseQuery(0)
; find all keys for this user
If DatabaseQuery(0, "SELECT * FROM Key WHERE UserID="+Str(UserID))
While NextDatabaseRow(0)
KeyUserID.l=GetDatabaseLong(0,1)
KeyProgramID.l=GetDatabaseLong(0,2)
Key.s=GetDatabaseString(0,3)
Ban.s=GetDatabaseString(0,4)
Program.s="ERROR"
; get the name for this programID
If DatabaseQuery(0, "SELECT Name FROM Program WHERE ID="+Str(KeyProgramID))
If FirstDatabaseRow(0)
Program = GetDatabaseString(0,2)
EndIf
;FinishDatabaseQuery(0)
Else
Debug DatabaseError()
EndIf
Text.s=Program+Chr(10)+Key+Chr(10)+Ban
AddGadgetItem(#ListIcon_UsersKeys,-1,Text)
Wend
EndIf
EndIf
FinishDatabaseQuery(0)
EndIf
can i only perform a single query at a time?