close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Best validation for MySQLi insert completed ?

Thread began 3/28/2016 12:25 pm by Steve | Last modified 3/29/2016 2:00 pm by Ray Borduin | 2826 views | 11 replies |

Steve

Best validation for MySQLi insert completed ?

Hello,
We have a form that is suffering from validations NOT catching various inputs people are entering.

No errors stop the page from moving to $WA_redirectURL

I'm surprised the MySQL DB does not throw an error but it seems not to be the case.

One of the prior found errors was a vachar field that was 14 characters in size but the person entered 15 characters. This caused the record not to be submitted but there was no error that stopped the page from moving to it's $WA_redirectURL location.

Is there a value we should poll before moving to the redirect page?

I understand we should have page level validation and we do, but since we don't get these errors stopping the flow it's hard to track down where problems exist.

Sign in to reply to this post

Ray BorduinWebAssist

I believe it should stop the page and throw an error. In the case of too many characters I think it should insert, but just the first 14 characters would be saved. If you have a url and steps to reproduce the problem I can debug it and see why it isn't behaving the way I would expect it to in your case.

Sign in to reply to this post
Did this help? Tips are appreciated...

Steve

I agree, the input should have been truncated and errors should show when encountered. Not sure why this is not happening.

Sign in to reply to this post

Ray BorduinWebAssist

Which field has the length limitation that I can use to reproduce the error?

Sign in to reply to this post
Did this help? Tips are appreciated...

Steve

That's the problem.. As we find a condition that prohibits an Insert but without error, we fix it such as adding a limitation on the input field for the 14/15 character problem.

Last case we believe was known was the List Relatives/ friends and How Referred text areas. We boosted those to 256 so probably a 'greater than' would reveal the problem but I have not confirmed. I can test further tomorrow.

Sign in to reply to this post

Steve

Hello, I have removed the input max-size from one of the fields that was identified as causing an issue before. Try 15 characters and it should fail in silence... Database fields info in attached images.

<div class="col-md-6"> First Available Start Date:
<input name="FirstAvailDate" type="text" id="FirstAvailDate" placeholder="mm/dd/yy" size="8" >
 </div>

Sign in to reply to this post

Ray BorduinWebAssist

I can't seem to actually upload files with the ftp credentials you supplied. I'll need to edit the code to fully debug.

Sign in to reply to this post
Did this help? Tips are appreciated...

Steve

Ack! Sorry Ray... I've changed the permissions.

Sign in to reply to this post

Ray BorduinWebAssist

I've updated your webassist/mysqli/queryobj.php file to the latest unreleased beta version which has additional debugging information.

You can turn off debug mode in that file and it will still stop the page from processing but not include as much details about the failure (recommended when going live to prevent would be hackers from knowing more information about your database than they should like table and column names).

Sign in to reply to this post
Did this help? Tips are appreciated...

Steve

Ray, so we now see when there is a conflict on INSERT? And the page will not proceed like it did prior?

Is there a way to interpret the errors in such a way that they could be made into a user-friendly alert to help the Applicant see where a problem may exist in their submission?

Sign in to reply to this post
loading

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...