Database Query problem

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cbarnhart
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 48
Joined: Mon May 07, 2012 2:10 pm

Database Query problem

Post by cbarnhart » Tue May 14, 2013 9:19 pm

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

Klaus
Posts: 14206
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Database Query problem

Post by Klaus » Wed May 15, 2013 4:04 pm

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

Post Reply