jkkenzie Posted October 29, 2008 Share Posted October 29, 2008 Hi! I have four fields in my table: Value, Country,Parameter and year: I display the DISTINCT values from country,Parameter and year on a web page on checkboxes where the user selects the countries, parameters and the year. I display like this: <?php $order=0; while($order < $count) { echo "<input type='checkbox' name='mycountries[]' value = ' ".$country[$order]."'>".$country[$order]. "<br />"; $order++; } echo "</td></div><td class='content'><div id='cBoxes2'>"; $order=0; while($order < $count1) { echo "<input type='checkbox' name='myparameters[]' value = ' ".$parameter[$order]."'>".$parameter[$order]. "<br />"; $order++; } echo "</td></div><td class='content'><div id='cBoxes3'>"; $order=0; while($order < $count2) { echo "<input type='checkbox' name='myyears[]' value = ' ".$year[$order]."'>".$year[$order]. "<br />"; $order++; } ?> Dont mind how i connect to database a get values: I would like to have a query that SELECTS FROM MY TABLE (tbldata) where the country= the several countries the user has selected AND the parameter=the several parameters the user has selected IF THE PARAMETER CHOSEN IS AVAILABLE i.e if the countryies chosen has that particular parameter AND WHERE the years=the chosen years (could be regular or irregular) thanks in advance. Jkkenzie Quote Link to comment https://forums.phpfreaks.com/topic/130536-help/ Share on other sites More sharing options...
jkkenzie Posted October 29, 2008 Author Share Posted October 29, 2008 I would like to have a query that SELECTS FROM MY TABLE (tbldata) where the country= the several countries the user has selected AND the parameter=the several parameters the user has selected IF THE PARAMETER CHOSEN IS AVAILABLE i.e if the countryies chosen has that particular parameter AND WHERE the years=the chosen years (could be regular or irregular) Anybody? Quote Link to comment https://forums.phpfreaks.com/topic/130536-help/#findComment-677211 Share on other sites More sharing options...
fenway Posted October 30, 2008 Share Posted October 30, 2008 You have to decide how to build your where clause using php logic. Quote Link to comment https://forums.phpfreaks.com/topic/130536-help/#findComment-678532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.