Page 1 of 1

Database Query problem

Posted: Tue May 14, 2013 9:19 pm
by cbarnhart
I have a login screen where the user enters their email. I then take the email and look up in a mySql table. If the email address is found it returns the user info in a datagrid. If it is not found it returns an error "user not found" message. Here is my code

put revQueryDatabase( theConnectionID, "select * from hospaccess.LogIn where eMail = '"&testUser&"'") into theCursor
if item 1 of theCursor = "revdberr" then
answer "User not found"
else
ConvertSQLCursorToArray theCursor, theDataGridArray
set the dgData of group "DataGrid3" to theDataGridArray
end if

It returns the data just fine when the user if found but when the user is not found it does nothing

Anyone have any ideas what I an doing wrong or has a better way I should be doing this?

Thank you
Chris

Re: Database Query problem

Posted: Wed May 15, 2013 4:04 pm
by Klaus
Hi Chris,

well, that is correct behavior! :-D

If there is no user with that email, there are also NO associated data for this (non) user!
What should be displayed in your opinion?


Best

Klaus