In a webshop admin, i am listing out the orders from sql. Here, i have a search form also, where i type in a keyword, and start search.
Now, i added a date from, and a date end input to the form. How can i add these to the sql select, if the admin enter the dates, not just the keyword only?
<td style="text-align: center;">
<input type="text" name="date_from" value="<?php if(isset($_POST['date_from'])) { echo $_POST['date_from'];} ?>" size="7" class="datepicker">
<span> - </span>
<input type="text" name="date_end" value="<?php if(isset($_POST['date_end'])) { echo $_POST['date_end'];} ?>" size="7" class="datepicker">
</td>
$sql = "SELECT rendeles_user_id , rendeles_id, nev, status, vegosszeg,br_vegosszeg, datum, ido, egyeb FROM rendeles_adatok WHERE $kereses_helye LIKE '%$kw%' ORDER BY $kereses_rendezes $kereses_sorrend";
$kereses_helye means that where i want to search. (user name, order id, email....)