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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

yikes! bug with sending emails to reverse order customers

Thread began 8/13/2014 10:39 am by Christopher West | Last modified 8/13/2014 1:59 pm by Jason Byrnes | 281 views | 5 replies |

Christopher WestCommunity Expert

yikes! bug with sending emails to reverse order customers

Hi I found out today after I was doing some testing which where I have a page in which the client selects customer orders from a list (checkbox select) What it does is updates their order status (Processing, Dispatched, Completed etc.) The updating of their order works through multiple checkbox selects. then its suppose to send those customers an email to tell them that their order has been updated....During testing I had 2 test orders I made with 2 different emails. when I selected my 2 orders it successfully updated the order record in the database, but I never received the email....HOWEVER I found out today that my client received an order update email and she also told me a customer had also receieved the same email..so it appears that the system was sending out an email in the reverse (in other words it must have sent the emails to ALL UNCHECKED orders in the database! But how could this be possible?

the recordset i am using for selecting all checked emails is:

<?php
if (isset($_POST["Save"])) {
mysql_select_db($database_dinkydb, $dinkydb);
$query_rsOpenOrderEmail = "SELECT * FROM orders WHERE OrderID IN (".implode(", ",$_POST["order-reference"]).")";
$rsOpenOrderEmail = mysql_query($query_rsOpenOrderEmail, $dinkydb) or die(mysql_error());
$row_rsOpenOrderEmail = mysql_fetch_assoc($rsOpenOrderEmail);
$totalRows_rsOpenOrderEmail = mysql_num_rows($rsOpenOrderEmail);
}
?>

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

attach a copy of the page so i can see the code in context.

Sign in to reply to this post

Christopher WestCommunity Expert

Here we go. attaching a zip file with a few files. (I had to recreate it as for the time being I needed to get a quick fix so I reverted back to my old code).

But wanted to find out why my new code was sending out the reverse list of emails that i would select in the checkbox select.

So when I recreated, its the same recreation I did when it first had this issue. I suppose I could do more testing with it if i delete all the customer orders and only kept a few email addresses that I use. least then customers wouldnt get the test emails.

Chris

Attached Files
test.zip
Sign in to reply to this post

Jason ByrnesWebAssist

looks like it should return the correct results,

to trouble, disaple the email temporarily by changeing the trigger code:

if ((isset($_POST["Save"]) || isset($_POST["Save_x"]))) {

to:
if ("" != "") {

then write the query to the page:
<?php echo($query_rsOpenOrderEmail); ?>

copy the SQL that generates and run that on the database directly using PHP myAdmin or another GUI tool.

Sign in to reply to this post

Christopher WestCommunity Expert

Thanks for the debugging tip :) well its odd because it now seems to work. (well I had deleted all other customer orders for testing and I guess I need to wait for my client to let me know if she got any emails herself (she shouldn't have that's the original bug that happened last night). So if she didn't get any order update emails tonight then that means its working fine.

its just really odd, because today I recreated the code as how I first created it last night when I found this bug. But if its working fine now, there must have been one very tiny thing I overlooked last night.

Jason, would you know of any situation of the top of your head that would send out emails to all records that were not selected from a checkbox. Perhaps if there was some kind of error then maybe it wasn't taking my selected records and somehow forced itself to use all the ones that weren't checked.

Sign in to reply to this post

Jason ByrnesWebAssist

I cant explain why it wasn't working last night, I would need to troubleshoot it when it is not working to be able to tell why.

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