close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

customer recordset used to update multiple orders...need to work out how to send email to all those customers...

Thread began 2/12/2014 1:25 am by Christopher West | Last modified 2/12/2014 2:10 pm by Jason Byrnes | 594 views | 7 replies |

Christopher WestCommunity Expert

customer recordset used to update multiple orders...need to work out how to send email to all those customers...

Hi. ok well after Ray helping me solve how to update multiple orders using checkboxes...I was wondering how I could also send out order updates to the corresponding emails that belong to the orders I had updated...

The custom code for the record uses an array implode...

php:
<?php

if (isset($_POST["Save"])) {
  
mysql_select_db($database_dinkydb$dinkydb);
  
$query_rsOrderDispatched "UPDATE orders SET OrderProcess = '".$_POST["order-update"]."' WHERE OrderID IN (".implode(", ",$_POST["order-reference"]).")";
  
mysql_query($query_rsOrderDispatched$dinkydb);
}
?>



Now is it a case of still using the Universal Email server behaviour and using the option:RecordSet Loop from the "To Settings" option in the Universal Email and then selecting my recordset for rsOrderDispatched? Or would it require a completely customised email sending function?

Im guessing that may not work as I already have another recordset called rsOrderDispatched has no filters since its used to display a record count (ok just thought that's a sloppy coding method using 2 recordsets the same name)

mysql_select_db($database_dinkydb, $dinkydb);
$query_rsOrderDispatched = "SELECT * FROM orders WHERE OrderProcess = 'Order Dispatched'";
setQueryBuilderSource($query_rsOrderDispatched,$WADA_Sort_1,false);
setQueryBuilderSource($query_rsOrderDispatched,$WADbSearch1,false);
$rsOrderDispatched = mysql_query($query_rsOrderDispatched, $dinkydb) or die(mysql_error());
$row_rsOrderDispatched = mysql_fetch_assoc($rsOrderDispatched);
$totalRows_rsOrderDispatched = mysql_num_rows($rsOrderDispatched);



Chris

Sign in to reply to this post

Jason ByrnesWebAssist

The custom update recordset that ray created is an update recordset, it will not return anything, only update the data in the database.

you would need another recordset to return the email addresses for the updated records using the same where clause, and change to a select statement.

then use that recordset in the universal behavior for the to loop

Sign in to reply to this post

Christopher WestCommunity Expert

HI, so a recordset like this:

php:
<?php

if (isset($_POST["Save"])) {
  
mysql_select_db($database_dinkydb$dinkydb);
  
$query_rsOpenOrdersEmail "SELECT orders WHERE OrderID IN (".implode(", ",$_POST["order-reference"]).")";
  
mysql_query($query_rsOpenOrdersEmail$dinkydb);
}
?>



Just wondered that this recordset would be triggered as it is using a $_POST So would need to be after my initial update at least. But then again its using isset POST['SAVE'] so that would be the trigger.

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that is correct.

Sign in to reply to this post

Christopher WestCommunity Expert

Assuming this error is relating to the second recordset. I have attached a screenshot to show the code and the error

What could be wrong with this recordset syntax?

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

SELECT orders

should be:
SELECT * FROM orders

Sign in to reply to this post

Christopher WestCommunity Expert

Jason....Lets keep this one between ourselves...cannot believe I missed that lol - When I was looking at the error message I thought it was pointing to near the WHERE clause was since that was part of the error - and that error related to reserved words.

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

no worries.

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