Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-26-2006, 02:42 AM   PM User | #1
dreamnet
New to the CF scene

 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
dreamnet is an unknown quantity at this point
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 02:59 AM..
dreamnet is offline   Reply With Quote
Old 08-26-2006, 04:46 AM   PM User | #2
marek_mar
Sensei


 
Join Date: Aug 2003
Location: One step ahead of you.
Posts: 2,815
Thanks: 0
Thanked 3 Times in 3 Posts
marek_mar is on a distinguished road
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.
marek_mar is offline   Reply With Quote
Old 08-26-2006, 05:35 AM   PM User | #3
dreamnet
New to the CF scene

 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
dreamnet is an unknown quantity at this point
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
dreamnet is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:32 PM.


Advertisement
Log in to turn off these ads.