CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Logical mistake in the store solution

Print topic Send  topic

Author Message

Posts: 10
Posted: 03/24/2012, 1:35 PM


Solution: Store, Page: Header, file: header_events.
After inserting new shoping_cart into DB, when the new cookie is created, the new cart id is taken using the SQL statement:
$SQL = "SELECT MAX(shopping_cart_id) FROM store_shopping_carts";
if($db->next_record()) {
$last_cart_id = $db->f(0);
It is possible to generate mistakes, because more than one person may make new shopping basket in the same time ...
The better option is to use PHP method:
$last_cart_id = mysql_insert_id();
thanks this you are sure of taking the proper ID because this method works in the current user session scope.


View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.