View Full Version : How to use php do the search in Json encode string?

08-26-2006, 03:42 AM
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..
{"general":{"category":{"language":"English"},"description":"this is a demo"},"education":{"language":"English","level":"3","cost":"yes"}}

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

08-26-2006, 05:46 AM
How about columns for the different values?

08-26-2006, 06:35 AM
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