...

View Full Version : Mysql like Not showing multiple words result



darma1985
01-27-2012, 09:21 AM
Below are my script


("SELECT * FROM products s WHERE name LIKE '%" . $queryString . "%' ORDER BY name LIMIT 8");

Example db
Product Name : Cadbury Centre Fill Chocolate Cookies 144g


User type : Centre Cookies cadbury

How can i view the results for multiple words contains

Now there are no result showing

Thanks in Advance

abduraooft
01-27-2012, 09:29 AM
Have a look into the mysql's fulltext search explained at http://devzone.zend.com/26/using-mysql-full-text-searching/ and dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

jmj001
01-27-2012, 11:41 AM
$queryString = "cadbury";
"SELECT * FROM products WHERE name LIKE '%" . $queryString . "%' ORDER BY name LIMIT 8";

would return you 8 results with cadbury in the name



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum