close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

INSERT behavior code is right, but no record gets created

Thread began 2/19/2020 1:49 pm by LionsMane | Last modified 2/20/2020 3:49 pm by Ray Borduin | 60 views | 9 replies |

LionsMane

INSERT behavior code is right, but no record gets created

I've been using these behaviors for years, and everything looks right. Simple form, inserting into mySQL. No errors in Console on the page. Form submits and redirects, but no record actually shows up in the table. No errors on the page. No errors in error logs. Just... nothing. Been staring at this for hours. Anyone seen this before???

Sign in to reply to this post

Ray BorduinWebAssist

Please attach the page and I'll see if I can spot the problem.

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

LionsMane

PM - file attached

PM

Sign in to reply to this post

Ray BorduinWebAssist

Find this line:

$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "list-vendors.php";


and update it to:

$InsertQuery->saveInSession("");
$InsertQuery->execute();

var_dump($InsertQuery);
die();

$InsertGoTo = "list-vendors.php";



That will print information about the insert onto the page and might give you information on how or why it fails.

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

LionsMane

Here in PM is what it outputs.. but I'm not sure it'a string issue, because no record actually gets initiated into the table at all.

Sign in to reply to this post

Ray BorduinWebAssist

You can see the error:

Data too long for column 'State' at row 1

You probably have state defined as two characters but you are trying to insert "Washington"

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

LionsMane

Hi, yes I saw the error, and tried it again with just two characters, but the behavior persists. No record is created. I'm a little surprised the error isn't expressed on the page in some way as well. Other suggestions?

Sign in to reply to this post

Ray BorduinWebAssist

What is the error when you do it with two characters? Send the output again and I can look.

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

LionsMane

With 2 characters in State field

Originally Said By: Ray Borduin
  What is the error when you do it with two characters? Send the output again and I can look.  



Found the error. There was also a required field in the DB table that wasn't noted as required on the form. insert working properly now. Still unsure why there wasn't any error on the page when the DB requirements weren't met, but maybe I'm expecting too much. ANyways, thanks for the help. Any chance we can get some updates on that custom code I sent before?

Sign in to reply to this post

Ray BorduinWebAssist

In general you don't want to show errors to your customers when they happen, so they aren't displayed by default. You can turn them on manually to debug like I showed you.

I'm not sure what custom code you are referring to. In general it is hard to comment on custom code and that is generally saved for paid premier support tickets.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...