close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SQL errors

Thread began 6/27/2009 12:48 pm by anonymous | Last modified 7/01/2009 11:30 am by Ray Borduin | 2297 views | 5 replies |

anonymous

SQL errors

Two errors:

1. In PowerStore, confirm.php, line 512.
$WA_indexField = "DetailOrderID";
should be: $WA_indexField = "DetailID";

2. Using the checkout wizard with eCart, paypal standard selected, I would think that the save to database should overlay the PowerStore schema.
a. $WA_fieldNamesStr = "OrderShipping|OrderTax|OrderTotal";
OrderTotal is not a field in the schema as defined in PowerStore. OrderAmount is probably the intended field but.....who knows without any comments in the schema.
b. $WA_indexField = "DetailsID"; is the generated code while it
should be: $WA_indexField = "DetailID";

While #2 is technically not a bug, it should be changed if for no other reason than maintainability by Webassist. It would also help the user.

Sign in to reply to this post

Ray BorduinWebAssist

1) In PowerStore, confirm.php, line 512... Should be as it is:
$WA_indexField = "DetailOrderID";

The index field it is asking for is actually the index field of the Cart, or the OrderTable index field, which is DetailOrderID.

You should change this back otherwise you may have issues with items being mysteriously deleted and extra items when someone goes to paypal and then returns to your site to shop again using paypal standard.

2) is technically not a bug, and the names were close enough so that you were able to logically deduce the correct association without aide of documentation. It is a valid point, but probably not worth updating at this point unless we were already updating the database structure of that table.

Sign in to reply to this post
Did this help? Tips are appreciated...

anonymous

Thank God for the safety net! Thanks Ray. I have more problems though in that I have to modify all of this for my new schema which incorporates options. With that in mind I'm trying to understand exactly what is happening in this section. From a high level we are building some sql strings to use in inserting the order details. There can be multiple rows for each purchase or row in the orders table. I don't understand why we are doing deletes here. Can you tell me from a high level why that happens? Then I have to change some columns and there is this column type thing going on.
$updateColType = "none,none,NULL|',none,''|',none,''|none,none,NULL|none,none,NULL";
It looks like we are building a two dimensional array for generating a sql string. Do you know from a high level what is going on there?

Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

Technically you shouldn't have to do deletes for order details when it is used in checkout.

The reason why it does deletes is that the same two server behaviors can be used to create a "registry" or "wish list" cart that updates every time you add an item to it. In that case you need to make sure old items are removed because the entire cart is re-inserted.

In the checkout scenario the delete code should never delete anything since there won't already be orders details associated with the order being inserted... so the delete does nothing in this case. In some cases users insert order details before going to paypal standard and just mark them as confirmed on return. This is another case where delete is needed in case someone cancels and decides to go back and continue shopping after visiting the paypal site.

The short answer is the delete is there just in case it is needed, but in your case it should not be needed but shouldnt' harm anything when configured properly.

The string is a standard string used in the DW insert and update server behaviors. We borrowed the syntax for consistancy. It is a multidimensional delimited array as you have guessed. You first break it into an array around the "|"... and there should be one for each column.

So this string has five columns. Then the next array is split around the comma... so you have two groups:

none,none,NULL

and:

',none,''

These change according to your database field type:

encapsulating character, included value ,not included value

encapsulating character is usually a single quote for text or varchar fields and none for numeric fields at least in mySQL.

included value replaces the actual submitted value when present. It is mostly used for checkboxes and boolean fields so that you insert 1 or 0 regardless of the actual input.

not included value is the default to use if the field is not included in the form.

Sign in to reply to this post
Did this help? Tips are appreciated...

anonymous

I can't seem to find where $_SESSION['OrderID'] is set. It's used a number of places but where is it ever set?

Sign in to reply to this post

Ray BorduinWebAssist

It is set in Store Cart Summary in database on the confirm page.

Sign in to reply to this post
Did this help? Tips are appreciated...

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