close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SQL syntax error

Thread began 6/17/2010 12:07 pm by mrobben375515 | Last modified 7/09/2010 2:12 pm by Jimmy Wu | 4583 views | 14 replies |

mrobben375515

SQL syntax error

I keep getting this error when I click on any of the product categories on the "Products" drop down menu...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ANDProductID IN (SELECT ProductID FROM ps3_productcategories AND(CategoryID = 3)' at line 1

and when I'm on a page the accordion menu on the side with the product categories doesn't work...it's probably related to the above error as well.

The url is www.1to1marketing-llc.com

thanks

Sign in to reply to this post

Jimmy Wu

This may be caused by the ANDProductID not having a space between them. Did you make any modifications to the query that gets the categories?

Sign in to reply to this post

mrobben375515

Not that I know of, can I upload some files so you can take a look?

Sign in to reply to this post

Jimmy Wu

Yes, if you upload your Products_Results.php page, I can take a look at it and see if there's an incorrectly coded query.

Sign in to reply to this post

mrobben375515

here it is...

Attached Files
Products_Results.zip
Sign in to reply to this post

Jimmy Wu

Try using the version I attached. This will ensure that there is a space between the AND and ProductID.

Attached Files
Products_Results.php.zip
Sign in to reply to this post

mrobben375515

posted it and now I get this error

WHERE ProductID IN (SELECT ProductID FROM ps3_productcategories WHERE (CategoryID = 4))

Sign in to reply to this post

Jimmy Wu

Just wanted to make sure that the query was being written out correctly. Go to line 85 of that page and delete this code:
die($WADbSearch1->whereClause);

Then run through again to see if you get an error.

Sign in to reply to this post

mrobben375515

got the initial error again...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ANDProductID IN (SELECT ProductID FROM ps3_productcategories AND(CategoryID = 6)' at line 1

Sign in to reply to this post

Jimmy Wu

On line 84, that should look like this:
$WADbSearch1->whereClause .= "ProductID IN (SELECT ProductID FROM ps3_productcategories WHERE (CategoryID = ".implode($_GET["ProductCategoryID"]," OR CategoryID = ")."))";

Change it to look like this:
$WADbSearch1->whereClause .= " ProductID IN (SELECT ProductID FROM ps3_productcategories WHERE (CategoryID = ".implode($_GET["ProductCategoryID"]," OR CategoryID = ").")) ";

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