Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Why do I always have funky issues with SQL in FM? Here's another...???

Featured Replies

I'm trying to build a very simple login for a web page. I've created a table in FM to store username's and password's. Right now I have 2 records in there:

testUser1 testPW1

testUser2 testPW2

When I create a recordset like:

SELECT * FROM POWebUsers

I indeed get a recordset with both records in it. However, if I try and check for values in username and password to authenticate a user:

SELECT * FROM POWebUsers WHERE username = 'testUser1' AND password = 'testPW1'

I get an empty recordset!? What on earth is going on here that's causing me to waste so much time on such a simple task? Any information would be greatly appreciated. Thanks!

  • Author

SELECT * FROM POWebUsers WHERE password <> 'testPW1'

successfully returns only the testUser2 record.

Then I try:

SELECT * FROM POWebUsers WHERE username <> 'testUser2'

And I get both records returned! I'm as confused as I've ever been.

username is a reserved word in standard SQL. It is likely returning the name you're logged in as. Try changing your field's name.

  • Author

Ok, now I've switched the field names from username and password to varUsername and varPassword. Then when I try

WHERE varUsername <> 'testUser2'

it works. However, I still can't make the whole thing work:

WHERE varUsername = 'testUser2' AND varPassword = 'testPW2'

  • Author

Ok...actually it does seem to be working now. I guess that did it. Thanks for the info!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.