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
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to use php do the search in Json encode string?

    I stored these two strings into mysql in deferent rows, and going to use php to do an advanced search engine, with description, language, education->level, cost ect..
    row1
    {"general":{"category":{"language":"English"},"description":"this is a demo"},"education":{"language":"English","level":"3","cost":"yes"}}

    row2
    {"general":{"category":{"language":"English"},"description":"this is a demo"},"education":{"language":"Franch","level":"3","cost":"yes"}}

    If a user going to do the search for education ->language , he inputs "english" for the search, if these string stored in mysql,
    .... where input="english" , will return both records,since both records have "english"

    but i only want education->language = english do the return

    How do I do this way?
    it's possible to return the results like sql
    LIKE '$inputstring' ie. input Fra for the search education->language return the content of row2

    for advanced, i need to do the search input as CQL : english OR franch , english AND france ...
    Last edited by dreamnet; 08-26-2006 at 03:59 AM.

  • #2
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    How about columns for the different values?
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #3
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there are about 100 elements and I hope all open tag, can do the edit, add
    that's why i stored all information in one column


  •  

    Posting Permissions

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