Hi.
I have a problem with getting a dynamic query from my form. I have four checkboxes. I want the user to combine them... so if you check box x and y, the query should look like: "SELECT * FROM table WHERE (x = 1 AND y = 1)"
At the moment I use this script which doesn't work exactly the way I would like it to do:
$query = "SELECT * FROM table WHERE (text = 'something_noone_would_type_in'";
if ( $schmal == "1" ) {$query .= " OR schmal = '1'";};
if ( $breit == "1" ) {$query .= " OR breit = '1'";};
if ( $klassisch == "1" ) {$query .= " OR klassisch = '1'";};
if ( $modern == "1" ) {$query .= " OR modern = '1'";};
$query .= ")";
I am really ashamed of that code!!! 🙂 So, could you please help me with it?
Thank you so much!
Julia