close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataBase doesn't update correctly when the same UserID orders a few orders behind each other.

Thread began 11/06/2013 3:14 am by Fritz Stickers | Last modified 11/07/2013 5:47 am by Jason Byrnes | 1594 views | 7 replies |

Fritz Stickers

DataBase doesn't update correctly when the same UserID orders a few orders behind each other.

When the same user orders 2 or more orders behind each other, the second order replaces the order before in the database (when it's the same user).
There is no new record for a second order from the same user. It seems like the database can not update fast enough or something like that.
It's strange.

Any suggestions please?

Sign in to reply to this post

Jason ByrnesWebAssist

add the following code to your checkout success page:

<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
@setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}

// Finally, destroy the session.
@session_destroy();
@session_regenerate_id();
?>
Sign in to reply to this post

Fritz Stickers

Sorry, I forgot to mention that my site is in ASP VBScript.

Sign in to reply to this post

Jason ByrnesWebAssist

use this code on the checkout success page:

<% Session.Abandon %>

Sign in to reply to this post

Fritz Stickers

I had already the WA eCart Clear Cart.
So the code now is (just before <!DOCTYPE html ....

<%
' WA eCart Clear Cart
if ((Request.ServerVariables("Request_Method") = "POST")) then
set stickersBE = WA_eCart_ClearCart(stickersBE)
Redirect_redirStr="index.asp"'_redirStr
if (Redirect_redirStr <> "") then
stickersBE_redirStr = Redirect_redirStr
end if
stickersBE_cartAction = "ClearCart"
end if
%>
<% Session.Abandon %>
Sign in to reply to this post

Jason ByrnesWebAssist

1) The clear cart code is set to trigger on post:

if ((Request.ServerVariables("Request_Method") = "POST")) then

you should set it to trigger an page load:
if (("" = "")) then

2) The code should not be before the doctype, it should be after the closing HTML.

Sign in to reply to this post

Fritz Stickers

Like this, after the recordsets and DB closing ?

</body>
<!-- InstanceEnd --></html>
<%
rsUsers.Close()
Set rsUsers = Nothing
Set rsUsers_cmd = Nothing
%>
<%
rsOrders.Close()
Set rsOrders = Nothing
%>
<% Call DB_Close() %>
<%
' WA eCart Clear Cart
if (("" = "")) then
set stickersBE = WA_eCart_ClearCart(stickersBE)
Redirect_redirStr="index.asp"'_redirStr
if (Redirect_redirStr <> "") then
stickersBE_redirStr = Redirect_redirStr
end if
stickersBE_cartAction = "ClearCart"
end if
%>
<% Session.Abandon %>
Sign in to reply to this post

Jason ByrnesWebAssist

yes, that is correct.

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