MySql Query help needed...

Hello, Ive a comma separated string in my php superglobal array(GET) which is generated on every checkbox checked each time (using ajax) like:a,b,c,d,e, total in 19. Now ive my data in mysql corresponding to the input i.e. a,b,c,d,e, and so on in 9 columns(12 in 3 & 7 in 7). What I want here is that when i check a data corresponding to a will fetch from db, which is not an issue but when i want to check any other checkbox suppose e while a is already there in GET, it becomes a,e, right, now how my query will be coz it can be anything instead of e anything. Hope I am clear to all of you. Thanks :slight_smile: And since the data is not in one column how can i filter my query on different checkbox checked may be more than two at one time??? :’(

Hi

When you check e then it pass a,e, right?

then in you PHP file explode it with (,) and take last value of array.

example:

$array = explode(’,’, “a,e,”);

this will return you array take last value or array and pass it in to your query.

Thanks Sarthak!

Actually What I was trying to do is clear to you just visit compareindia.in.co
There you will find checkbox filter by title Narrow your search having Brand|Budget|Key Features|Additional Features. However I am completely a fresher developer and love to learn by myself but logic development on one’s own is not so easy, hoever, I have done a lot what I was trying to do, but still only able to filter each category as mentioned above and each category in itself not altogether per category, right now I am stuck on key features how to generate query with less code combining type|connectivity|format|cd|speaker.

Hope to hear from you… :slight_smile: :-* to logic development as well as designing though just HTML/CSS Markup, however for a fresher/learner it is :o :-X :-\ :’( ??? >:( :frowning: Nine isn’t it

Sponsor our Newsletter | Privacy Policy | Terms of Service