I have problem selecting some dates, here is html and php code:
 <div id = "date">
    <form action = "selectdate.php" method = "POST">
        From date: <input type = "date" name = "date" required>
        <input type = "date" name = "referer" style = "display: none" value = "<?=$date?>">
        <br />
        <br />
        To date: <input type = "date" name = "date" required>
        <input type = "date" name = "referer" style = "display: none" value = "<?=$date?>">     
        <input type = "submit" name = "submit" value = "get data">
  <br/>
    </form>
and php
    $result = pg_exec("SELECT kv.ph, kv.date FROM public.kv WHERE date BETWEEN
 '" . $_POST['date'] . "' AND  '" . $_POST['date']. "' ORDER BY date");
Result is only one record, and only shows record from last input date. I want to show records between this two dates. One more question, why WHERE operator don't work with text columns? I am using php 5.5. Big thanks in advance.
 
    