close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error in SQL Syntax

Thread began 2/12/2015 9:50 am by randyrie405335 | Last modified 8/10/2015 2:07 pm by Ray Borduin | 1029 views | 10 replies |

randyrie405335

Error in SQL Syntax

Whenever I attempt to add a "Display Record Count" to a working page designed to search for and delete found records, the record set is changed and gives a "Error in SQL Syntax" error. The recordset's WHERE statement is changed from "WHERE registrants.LastName = varLastName" to "WHERE registrants.LastName = %s LIMIT 1" which causes the error. If I manually change the WHERE statement back, the error goes away but the page's search and delete functions get broken. The more I try to resolve this, the more 'broken' the page becomes - becomming a vicious cycle. If I remove the code for the "DIsplay Record Count" and reset the recordset, the page works again.

The same thing happens whenever I try to add "Recordset Paging" to an otherwise working page. I'm convinced these two elements of the MySQLi extension are faulty.

I am attaching the page for you to review. Any suggestions?

Attached Files
admin_reg_delete.php
Sign in to reply to this post

Jason ByrnesWebAssist

What is your OS?

What version of DW are you using?

What version of MySQLi is installed? the most recent version is 1.0.3.

if you have a previous version installed, please uninstall it fro the extension manager before installing the newer one.

also, it may be that you have an older version of the webassist/mysqli/rsobj.php file in your site.

try deleting that file both on your local and remote server, when you edit the recordset, it will regenerate it.

Sign in to reply to this post

randyrie405335

Error in SQL Syntax

OSX 10.5.9
DW CS6
MySQLi 1.0.3

Sign in to reply to this post

Jason ByrnesWebAssist

Did you read the lat part of my reply:

also, it may be that you have an older version of the webassist/mysqli/rsobj.php file in your site.

try deleting that file both on your local and remote server, when you edit the recordset, it will regenerate it.

did you try that?

Sign in to reply to this post

randyrie405335

Sorry... I've been on travel. I'll try your suggestion when I'm back in my office later next week.

Sign in to reply to this post

anonymous

jenniferR

I'm having this same issue. I just purchased and downloaded installed both DWCC and the webassist extensions.

I have one report page that has about 20 recordsets. I've deleted old and replaced with MySQLi recordsets. I've updated all the fields. I've removed the security and replace with Secure Page wizard. This works on other pages.

About 99/100 times when I try to use the record count feature in the webassist extension, it crashes DW before the wizard box can fully load. The one time it works, it gives the code:

<?php echo $recordset->TotalRows; ?>

However when you begin to type in $recordset and then type in -> the available actions pop up for you to select. TotalRows does not appear in this list. It seems to me that the wizard creates a sequence of code that is in conflict with the programming.

When I try to load the page it get "Error in SQL syntax". When I do a find on this phrase on my entire current site, it only appears once in the code. In the rsobj.php file in the webassist directly. Specifically this part:

public function execute() {
$statement = $this->Statement;
if ($this->MaxRows && !isset($_GET['totalRows_'.$this->Name])) {
$statement = preg_replace('/^select /i',"SELECT SQL_CALC_FOUND_ROWS ",$statement);
}
if ($this->MaxRows) $statement .= " LIMIT ".$this->StartLimit.",".$this->MaxRows;
$query = $this->Connection->Prepare($statement);
if (!$query) {
die("Error in SQL syntax");
return;
}

I've deleted the rsobj.php file and recreated it as described above. I've deleted my webassist directly on my remote server and reuploaded it from my local server.

Nothing seems to fix this error.

I'm reluctant to remove all instances of my total rows code since for each section i use it to hide or show div's based on if totalrows > 0.

Sign in to reply to this post

anonymous

jenniferR

When all code related to total rows is removed, the error still occurs. Im stumped because the only time that error phrase is found on my site is related to total rows code.....

Sign in to reply to this post

anonymous

jenniferR

the error is triggered by the execute() function. all calls to this function on the page come from recordsets which were generated by webassist wizards. when i doubleclicked on each one, three of them had changes to the code when i clicked ok. saved, uploaded and STILL the same error.

when i delete and redo the recordsets with the wizard it puts a limit of 1 on each. wth?

Sign in to reply to this post

anonymous

jenniferR

No amount of fiddling was helping. the only thing that worked was remove every deprecated server behaviour through the DW panel. Look through your code to see if anything was left behind. Then re-do the entire page again.

THEN it works.

The recordsets are still created with a limit of 1 by default it seems, but when you put it into a repeating region it removes the limit.

Webassist still crashes DW constantly. If I was working on a PC when a crash takes minutes for the software to close down and more minutes to either reboot the computer and open the software again... I'm now on a mac so it crashes in half a second and takes on second to get everything back again. Not a good reason to keep using software that costs a significant amount of money..... please fix the crashing.

Sign in to reply to this post

Ray BorduinWebAssist

It puts the limit 1 on to make it efficient since only one row will be displayed until you add a repeat region. The repeat region will automatically add the appropriate LIMIT statement to reflect the number of rows you are displaying.

The error means there is a problem with your SQL statement syntax. If you open the rsobj.php file you can update the debug setting to: true and that will give you a better error.

What is the SQL statement you are using in your recordset?

Sign in to reply to this post
loading

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