close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

MySQLi Database Search

Thread began 3/09/2016 2:35 pm by markdoyle87077 | Last modified 6/10/2016 4:15 pm by markdoyle87077 | 513 views | 20 replies

markdoyle87077

I have set my search page up and created the recordset below which works fine. The issue I am having is that if I search for Hello Kitty Bubble nothing is returned as the search is checking that the column description in the database contains the search phrase. The description in the database is Hello Kitty Single Bubble. I thought using the LIKE feature would return the record but it does not; if I search for Hello Kitty Single then the record is returned correctly. It seems as though records are only returned if the search phrase matches in the exact order it is stored in the database. Is this correct or is there a bug.

<?php
$rs_bubbles = new WA_MySQLi_RS("rs_bubbles",$dmbc_database,0);
$rs_bubbles->setQuery("SELECT products.id, products.itemnumber, products.description, products.categories, products.category_type, products.status, products.type, products.productdescription, products.typename, products.selling_quantity, products.price, products.image, products.imagelarge, products.volumediscount, products.supplier, products.supplierlogo, products.stock, products.onorder, products.packed, products.customer_back_orders, products.pending_online_orders, products.visible, products.product_arrival_date, special_prices.price AS special_price FROM products LEFT OUTER JOIN special_prices ON products.itemnumber = special_prices.itemnumber AND special_prices.userdetails_id = ? WHERE visible = 1 AND description LIKE ? AND category_type='Bubbles' OR visible = 1 AND keywords LIKE ? AND category_type='Bubbles' ORDER BY type, description ASC");
$rs_bubbles->bindParam("i", "".($rs_customer->getColumnVal("id")) ."", "-1"); //colname
$rs_bubbles->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname1
$rs_bubbles->bindParam("c", "".(isset($_SESSION['keywords'])?$_SESSION['keywords']:"") ."", "-1"); //colname2
$rs_bubbles->execute();
?>

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