I made this form in the "index page" and when i did : echo $ days it in the "search_results.php" page ,it was ok Now i have made another form in the "search_results.php" and in the "continute.php" i calculated the sum of the checkboxes selection but my problem now is: i want to compare between the $days in the "index.php " and the $sum of the checkboxs selection but each time i try to echo $days in the "contniue.php" it deosnt seem to see it why???
Let me tell you first that you need to read a good tutorial about passing variables with php, I don't wanna scare you now. well... try this echo "<form action='calculate.php' method='post'>"; while($record=mysqli_fetch_assoc($result)){ $days_db=$record['days']; echo "<input type='checkbox' name='choose[]' value='{$days_db}' />"; echo "<input type='hidden' name='days' value='$days' />"; echo "<input type='submit' name='submit' value='Continue'>"; echo "</form>"; PHP:
but please i have another problem in mysql query my select is i have records conatins :5,10,15 days every time i choose +/-7 days which has the values 7 it gives me 0 and when i select +/14 which has the value 14 its gives me the days 5,15 and when i select +/-21 its gives me the days 5 why???????? i think mysql query contains something wrong ???
Ok tthnxxxx i was putting it as varchar in my database and when i changed it to int it worked just fine thnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx