close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

error your SQL syntax

Thread began 10/10/2016 1:21 pm by malcolm230194 | Last modified 10/11/2016 3:05 pm by Ray Borduin | 1551 views | 6 replies |

malcolm230194

error your SQL syntax

The following code is generated by eCart. and crashes with 'You have an error in your SQL sytax. It has affected two sites that were previously working. They both crashed after templates were updated containing changes in unrelated code.

The page is an order confirmation and runs perfectly if this section is commented out, though obvoiusly doesn't do what was intended.

Another problem with this is that it will only run on the local server as root even thouigh the user a/c is valid and tested in MySQL Workbench. This is a serious reputational and financial problem and I would appreciate your early attention

You will also see in the attached code some hacks going round in circles with session variables to try to save the order number correctly. I gave up trying to do it by the book as I got nowhere and every saved order had the number 400007. Christ only knows where that came from but it consistently appeared. Pragmatism overuled purity.

I'm in your hands.

Malcolm

Sign in to reply to this post

Ray BorduinWebAssist

You have this on line 118:

$ConditionalQuery->bindColumn("OrderType", "d", "K", "WA_DEFAULT");

That means that you have the data type set to numeric, but have set the value to "K"... that is incompatible and will cause a syntax error.

What is the data type of the OrderType column in your database? That row should probably either be:
$ConditionalQuery->bindColumn("OrderType", "s", "K", "WA_DEFAULT");

or:
$ConditionalQuery->bindColumn("OrderType", "d", "1", "WA_DEFAULT");

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

malcolm230194

eCart and or MySQLi is generating corrupt code

Good morning Ray

Firstly the data type error was an oversight in my attempt to recreate the page and not the problem.

The problem lies in the store cart details generated by eCart. By commenting out everything else I'm left with this code which generates your error message from line 124 in rsobj.php.

$ReplaceConnection = $store_i;
$ReplaceTable = "order_detail";
$ReplaceQuery = new WA_MySQLi_Query($ReplaceConnection);
$ReplaceQuery->Action = "delete";
$ReplaceQuery->Table = $ReplaceTable;
$ReplaceQuery->addFilter("DetailOrderID", "=", "d", "".$_SESSION['OrderID'] ."");
$ReplaceQuery->execute();

Please treat this as a matter of urgency as these are live sites that have stopped working. I've put test site information in the private message.

I've attached the file again for you to see

I've also experienced the following error when trying to add or edit another recordset on the same page. Test is fine after setting up the query but trying to save it gives the following message.

'error while executing applyServerBehaviour in MySQLiRecoredset.htm, a javascript error occurred'

I've done the usual of clearing the Dreamweaver cache but it doesn't change.

Sign in to reply to this post

malcolm230194

PS

This post has been deleted.

Ray BorduinWebAssist

It looks like you have your Store cart summary and store cart details server behaviors set with a trigger "before page load", but the inserts refer to posted form values.

Update the two server behaviors to use "any form post" as the trigger instead... but that isn't the problem.

In order to find out your actual error I turned debug mode on in the queryobj.php file. That shows the true error instead of the general error when an action fails. The real error is:

DELETE command denied to user 'xxxxxxx'@'localhost' for table 'order_detail'

This means that your database user doesn't have the correct permissions to allow a delete from the order_detail table. You can fix the problem by going into the database and updating the user permissions to allow delete on that table.

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

malcolm230194

Thank you

Thanks for your prompt reply Ray. You're a life saver.

One problem that is still unsolved though is why I can't add or change another dataset when the eCart server behavious are on the page. Any ideas?

Best regards
Malcolm

Sign in to reply to this post

Ray BorduinWebAssist

The broken eCart Object server behavior seems to be preventing the recordset update from working. I think if you add this code just above the doctype tag it will fix the eCart Object, and that would also fix the Recordset issue.

php:
<?php

// WA eCart Redirect
if ($eCart1->redirStr != "")     {
  
header("Location: ".$eCart1->redirStr);
}
?>



I've also attached a file that would prevent the error even with a broken eCart server behavior. You can replace it in your user configuration folder in this location:

Configuration/ServerBehaviors/PHP_MySQL/WebAssist/MySQLi/FieldTypes.js

Attached Files
FieldTypes.js
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...