close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

server validation to check form value with database

Thread began 5/26/2017 6:33 am by georgina_barrett_187762 | Last modified 5/31/2017 10:58 am by Ray Borduin | 61 views | 4 replies |

georgina_barrett_187762

server validation to check form value with database

I am trying to set up a server validation to check whether a form value matches a value in the database before allowing the form to be submitted. I have done this before using the number validation, however this time I am using mysqli. Everytime I submit the form it fails (even though I am entering a correct value). I have attached the code.

Attached Files
absentrequest2.php
Sign in to reply to this post

Ray BorduinWebAssist

I think you need parenthesis in your where clause.

This is what you have:
WHERE loginlevels.loginlevel=1 OR loginlevels.loginlevel=6 AND loginlevels.password=?

This is what you need:
WHERE (loginlevels.loginlevel=1 OR loginlevels.loginlevel=6) AND loginlevels.password=?

Sign in to reply to this post

georgina_barrett_187762

oops - school boy error, I have amended that.

However that isn't the problem. I echoed the recordset to make sure I was getting results - and I am but when I submit the form I just get the error validation. The form never submits even though I am using a matching password.

Sign in to reply to this post

Ray BorduinWebAssist

Your validation is set up to make sure there is no row returned. You have the maximum number of rows set to 0. If you want it to pass when a row is returned then the minimum should be set to 1.

Sign in to reply to this post

georgina_barrett_187762

That would do it ;) Thank you so much!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...