close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

MySQLi using LIKE with URL parameter not working correctly

Thread began 2/17/2016 4:54 pm by John | Last modified 2/18/2016 4:21 pm by John | 4091 views | 8 replies

John

MySQLi using LIKE with URL parameter not working correctly

I am transitioning from Dreamweaver CS6 PHP/MySQL to Dreamweaver CC 2015 and MySQLi using the WebAssist Suite (it's been a VERY frustrating experience). I have a very simple recordset and it takes the URL parameter as the variable, so I send to the page something like this:

http://69.16.243.60/~dijkstr1/books-by-subj_TEST.php?subject1=history

And it works fine because the category = history. But my query has LIKE, not = so when the category is, say, Literary Fiction and I use:

http://69.16.243.60/~dijkstr1/books-by-subj_TEST.php?subject1=literary

It delivers no results, and I need to have this functionality for a number of purposes on the site. If I use subject1=Literary Fiction it works, but that's not what I need, especially when I start searching two different fields with that one word (can't wait to see how much fun that will be).

Here is the recordset:

<?php
$rsBySubject = new WA_MySQLi_RS("rsBySubject",$connProjMain1,1);
$rsBySubject->setQuery("SELECT isbn13, coverimage, title, full_title, subtitle, subject1, subject2, active_web, pub_date, auth_id, publisher FROM books WHERE subject1 LIKE ? ORDER BY pub_date ASC");
$rsBySubject->bindParam("s", "".(isset($_GET['subject1'])?$_GET['subject1']:"") ."", "-1"); //colname
$rsBySubject->execute();
?>

This is about as simple as you can get and I generated it using the "Simple" interface in the WebAssist MySQLi recordset creator. When I hit "Test" in the dialogue box it initially works, but when I save it and open the browser using the link above I get no results. Interesting aside... when I then reopen the dialogue box to edit the recordset (after it crashes DW CC a few times) it will no longer go back to the simple interface - it says the query is too complex. But I did nothing to it. So it will still return results for subject1 = but not for subject1 LIKE.

I would appreciate any help. I used to rip through this stuff in DW CS6 and MySQL and now everything is a struggle and I'm getting further behind on this project.

Thanks,
John Burke

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