close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search page error

Thread began 4/26/2012 6:04 am by anonymous | Last modified 4/26/2012 4:35 pm by Jason Byrnes | 1810 views | 7 replies |

anonymous

Search page error

After completing the Search Wizard, I'm getting the following error message when I preview in browser:

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 0=0' at line 1

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the results page in a zip archive so i can see the code please. can't troubleshoot an error without seeing the code causing it...

Sign in to reply to this post

anonymous

Here it is Jason - but it's the Search page, not the Results.

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

Jason ByrnesWebAssist

change line 51:
$WADbSearch2_DefaultWhere = "WHERE 0=0";

to:
$WADbSearch2_DefaultWhere = " 0=0";




the default where clause should not include the word WHERE

this causes the where clause to be:

WHERE WHERE 0=0

Sign in to reply to this post

anonymous

OK. I got rid of the 2nd WHERE (although the page was generated that way by the Search Wizard), but now I'm getting this:

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 '0=0 AND (((itemName LIKE '%polo%')) OR ((itemName LIKE '%Shirt%')))' at line 1

Sign in to reply to this post

Jason ByrnesWebAssist

the wizard wont include a default where unless you enter one. you have 3 Data Assist search behaviors on this page, the other 2 don't have the default where clause.

try removing the default where clause altogether:
$WADbSearch2_DefaultWhere = "";


it's not really needed for your page anyway.

Sign in to reply to this post

anonymous

OK. I wiped the php code and started from scratch. I no longer have error messages, but when I try to do a search, nothing happens. Attached is the updated page. Sorry for all this, but it's just not working.

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

Jason ByrnesWebAssist

you have not added the results display to the page.


in design view, add a table to the page, set it to 1 row and as many columns as you would like to display from the recordset.

go to the bindings panel and expand the recordset, select each column you would like to display and drag the binding to a column of the table.

in the tag selector, select the tr tag, then on the Server Behaviors panel, click the plus button and select Repeat region to add a repeat to the table to show the records that are returned .


the data assist search wizard creates the search form and the code for filtering the recordset, you need to create the results display.

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