Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mysql like Not showing multiple words result

    Below are my script

    PHP Code:
    ("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

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Have a look into the mysql's fulltext search explained at http://devzone.zend.com/26/using-mys...ext-searching/ and dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Posts
    271
    Thanks
    2
    Thanked 65 Times in 65 Posts
    PHP Code:
    $queryString "cadbury";
    "SELECT * FROM products WHERE name LIKE '%" $queryString "%' ORDER BY name LIMIT 8"
    would return you 8 results with cadbury in the name


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •