close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

syntax error, unexpected ')' when using DataAssist Sort

Thread began 11/20/2014 8:32 am by sabastian130416448 | Last modified 11/24/2014 2:13 pm by Jason Byrnes | 580 views | 7 replies |

sabastian130416448

syntax error, unexpected ')' when using DataAssist Sort

Hi guys.

I am trying to create a function where my customers can sort the results page according to how they want the products displayed.

Now I followed the tutorial all the way through but when I finish I keep getting this error no matter what I do (Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\henkorsite\shopping-pages-template1.php on line 156)

I have attached the page and hope that you can help me out.

Thanks

Attached Files
shopping-pages-template1.rar
Sign in to reply to this post

Jason ByrnesWebAssist

156 is the query line, change:
$query_RcrdsetHenkor = sprintf("SELECT * FROM product_range WHERE name_tb LIKE '%tiger nut", );


to:
$query_RcrdsetHenkor = "SELECT * FROM product_range WHERE name_tb LIKE '%tiger nut'";

Sign in to reply to this post

sabastian130416448

Now I get these three errors.

Notice: Undefined variable: WADA_Sort_1 in C:\xampp\htdocs\henkorsite\shopping-pages-template1.php on line 157

Notice: Trying to get property of non-object in C:\xampp\htdocs\WADbSearch\HelperPHP.php on line 381

Notice: Trying to get property of non-object in C:\xampp\htdocs\WADbSearch\HelperPHP.php on line 395

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

sabastian130416448

See private message.

Sign in to reply to this post

Jason ByrnesWebAssist

the data assist sort code block:

<?php
//WA DataAssist Sort (Copyright 2007, WebAssist.com)
//Recordset: RcrdsetHenkor;
$WADA_Sort_1 = new WADA_SortObject();
$WADA_Sort_1->DefaultSort = "";
$WADA_Sort_1->ColumnList = "".((isset($_GET["sort"]))?$_GET["sort"]:"") ."";
$WADA_Sort_1->SortOrderList = "Ascending";
$WADA_Sort_1->ToggleOn = true;
if ((((isset($_GET["sort"]))?$_GET["sort"]:"") != "")) {
$WADA_Sort_1->SetToClause = $WADA_Sort_1->getDefaultSetToClause();
if ($WADA_Sort_1->ToggleOn && isset($_SESSION["WADA_OrderClause_shoppingpagestemplate1"])) {
$WADA_Sort_1->ToggleClause = $_SESSION["WADA_OrderClause_shoppingpagestemplate1"];
}
}
else if (isset($_SESSION["WADA_OrderClause_shoppingpagestemplate1"])) {
$WADA_Sort_1->SetToClause = $_SESSION["WADA_OrderClause_shoppingpagestemplate1"];
}
$WADA_Sort_1->initialize();
$_SESSION["WADA_OrderClause_shoppingpagestemplate1"] = $WADA_Sort_1->SetToClause;
?>



was in the wrong location, i moved it to line 124 to fix the error

Sign in to reply to this post

sabastian130416448

Ok I moved the coding on my testing server to line 124 but now I get no results?

Sign in to reply to this post

Jason ByrnesWebAssist

that's a problem with the recordset query.

your where claus:
WHERE name_tb LIKE '%tiger nut'

is looking for the string "tiger nut" at the end of the name it will only return a result if the the name ends with "tiger nut". your not getting any results because you don't have any products whose name ends with "tiger nut"

if I change that to:
WHERE name_tb LIKE '%tiger nut%'

it is looking for the string "tiger nut" anywhere in the name, and returns a result.

be careful with the wild card characters when doing a like query. depending on how you use the wild card, you create a 'Begins With', 'Ends With', Or 'Contains' condition:

Begins with 'foo'
SELECT * FROM tableName WHERE columnName LIKE 'foo%'

Contains 'foo'
SELECT * FROM tableName WHERE columnName LIKE %foo%'

Ends with 'foo'
SELECT * FROM tableName WHERE columnName LIKE '%foo'

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