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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

multiple update on page load doesn't work. By button does

Thread began 2/25/2016 7:18 am by Sweens | Last modified 2/25/2016 3:21 pm by Ray Borduin | 339 views | 8 replies |

Sweens

multiple update on page load doesn't work. By button does

Hi

I have a multiple update form, attached, which works properly when it is assigned to update when the button is clicked - but if I try to change this to anything else (ideally, 'on page load' is wanted, but I've tried 'if recordset not empty', 'if session x exists' etc) the update fails (and the redirect loses its parameter).

Can you spot anything obvious?

Thanks
Chris

Sign in to reply to this post

Ray BorduinWebAssist

How could it update "before page load" when it is updating based on the sort order submitted with the form? If it updated before page load and redirected then the page would never show? I'm a bit confused about what you are trying to do.

Sign in to reply to this post

Sweens

Hi Ray

I thought that was the whole point of the extension having 'before page load'.

http://www.webassist.com/forums/posts.php?id=17347

Is there another way of updating the multiple records without the user having to click a button?

Many thanks

Chris

Sign in to reply to this post

Ray BorduinWebAssist

The page loads before it is displayed.... so I think you want "any form submit"? You can do it "before page load" but the page will never be displayed, so I don't think that is what you want.

How do you want it to work?

Sign in to reply to this post

Sweens

Hi Ray

I'm hoping that those records without a sortorder value will be updated to the RepImgID value (this is the primary key).

An update query would look something like

update pageimages set sortorder = repimgid where sortorder is null and PgID=$_GET['PgID'] - I can do this direct in the database, but don't know how to do it on the page, if the extension doesn't work as I thought.

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

It will not work like that. It is designed to update based on user-configurable fields from a form. However what you want is a pretty easy query to just run on the page like:

<?php
mysql_select_db($database_connRoSite, $connRoSite);
mysql_query("UPDATE pageimages SET SortOrder = RepImgID WHERE SortOrder IS NULL", $connRoSite);
?>

Sign in to reply to this post

Sweens

Thanks Ray

For future proofing, how would this be with a mysqli update (I have connRoSite_i for other pages - roll on the new extension!)

Thanks
Chris

Sign in to reply to this post

Ray BorduinWebAssist

It is nearly identical using the queryobj.php include:

<?php
$Query = new WA_MySQLi_Query($localhost_i);
$Query ->Statement = "UPDATE pageimages SET SortOrder = RepImgID WHERE SortOrder IS NULL";
$Query ->execute();
?>

Sign in to reply to this post

Sweens

Thanks for your help, Ray

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