close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

column toggling

Thread began 7/27/2015 2:29 pm by Jamie | Last modified 7/30/2015 8:02 pm by Ray Borduin | 1660 views | 6 replies |

Jamie

column toggling

Hey Ray

Have been following this tut http://www.webassist.com/tutorials/How-to-enable-sorting-of-dynamic-data to toggle a column and have tried doing it twice but I am getting the error:

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 'WHERE ProductID = 0 ORDER BY ProductName DESC LIMIT 0, 1000' at line 1

each time.

Have attached the file

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

Add this code to line 190:

die($query_WADAproducts);

That will display the full query and could give us a better clue about where it is going wrong.

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

Jamie

at line 190?

Sign in to reply to this post

Ray BorduinWebAssist

You want it right before line 191:

$WADAproducts = mysql_query($query_WADAproducts, $PowerCMSConnection) or die(mysql_error());

that is the line the is connecting to the database and giving the error. So adding that to line 190 will let you see the query being used so that we can try to spot the issue.

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

Jamie

OK, have put it there - was just querying it as that is the code block for the update column order that was created a long time ago rather than the column toggle...

With the die statement at line 190, I am still getting the same error:

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 'WHERE ProductID = 0 ORDER BY ProductName ASC LIMIT 0, 1000' at line 1



on closer inspection, I moved the die statement to line 211 and get this error:

UPDATE products SET ProductOrder = WHERE ProductID = 0 ORDER BY ProductName ASC
Sign in to reply to this post

Ray BorduinWebAssist

I'm confused about what you are trying to do on that page. It looks like update statements, but you have query builder sorts and filters applied. Then you have this $start variable that you are incrementing above in an IF statment but you are doing almost the same update below outside of the IF.

I think I'd have to debug this with you in a premier ticket to get a better idea of what you are trying to achieve.

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

Jamie

ok, been 'playing around' with the page and have removed the update order and got the toggle working

basically I had been using this http://prntscr.com/7ydm4g to allow the client to re-order items rather than doing it by asc or dec so I guess that was conflicting with the column toggle as per that tut i referenced.

Jamie

Sign in to reply to this post

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