close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Updating an insert page

Thread began 4/24/2019 12:47 pm by john70964 | Last modified 5/01/2019 2:02 pm by Ray Borduin | 1114 views | 10 replies |

john70964

Updating an insert page

Hello Ray
I am trying to update an insert page.
The page has validations applied to a name and email field.

If I submit the page with the fields correctly filled in I get errors;
Warning: mysql_select_db() expects parameter 2 to be resource, object given in
C:\xampp\htdocs\boatsforsalenow_mysqli2\Enquiries\boatenquiry_insert.php on line 78

Warning: mysql_query() expects parameter 2 to be resource, object given in
C:\xampp\htdocs\boatsforsalenow_mysqli2\Enquiries\boatenquiry_insert.php on line 82

If I submit the form without validated information the validation remarks show but the record details are missing.

I wonder if you can see where the update is going wrong.
Many thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

Your insert code hasn't been updated to MySQLi but it only has a MySQLi connection on the page. Updating the Insert Record server behavior to MySQLi should correct the problem.

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

john70964

Hello Ray
Thank you for the help.
I still have a problem with the page Enquiries/boatenquiry_insert.

If I open index.php in a browser (F12) and from the menu open Manufacturers/Search by text
select a boat this opens the page boat-details.php
On the page I click the Request details button this take me to the page Enquiries/boatenquiry_insert.php?

The page appears correctly but if I make a mistake and do not fill in the required fields ie Name* and email*
and then click the send button the message
Please enter your name and Address appears OK but the boat details disappear.

I suspect this maybe something to do with Persistence but I cannot see how this can be inserted correctly.

If I then go back to the menu to start again when I reach the page Enquiries/boatenquiry_insert.php?
the messages Please enter your name. . and Please enter your email address. are not hidden.

Thanks for your help I hope I have made this clear.

Sign in to reply to this post

Ray BorduinWebAssist

Update line 6 of boatenquiry_insert.php to:

$WAFV_Redirect = "boatenquiry_insert.php?RecNo=".$_GET['RecNo'] ."&invalid=true";

That way it will pass the RecNo forward after failed validation so the recordset can use that to filter and populate the page.

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

john70964

Thanks Ray,
I changed line 6 and on my local machine I still had the same problem, but when I updated the remote server the page was working correctly.

Just one thing appeared incorrect, when the send button is pressed without entry into the validated fields the warnings do not appear, but the field changes to red and when the field is corrected the field changes to green.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like you have the old Spry validation for client validation on the page. I'd suggest removing that and adding webassist jquery validation instead. Spry is out of date and shouldn't be used.

You could simply remove the client validation and use just server validation if you wanted as well.

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

john70964

Thanks Ray,
I am wondering what is the best method of removing the spry as there is no SB for removing spry.

There are a number of lines which include Spry, are these the only ones to be removed?
Lines 114 115 231 261 355 356

Sign in to reply to this post

Ray BorduinWebAssist

Do a search for Spry on the page. Remove any reference to it. Start with that and see where it gets you. If you have issues, post the updated page and I'll take a look.

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

john70964

Thanks Ray
Please see pm

Sign in to reply to this post

Ray BorduinWebAssist

On line 218 remove the action for the <form> tag and set it to: action="". That will make it automatically forward the ID from the url.

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