PHP mysql选择日期范围不起作用

I use this code to get a data from a date range.But it only shows one row as result. mysql "Date" column uses the "Date" as datatype. Tell me what I'm doing wrong.

if(isset($_POST['from'])&& isset($_POST['to'])){
    include_once('../connection.php');
    echo $from= $_POST['from'];
      echo $to=$_POST['to'];
      $query_view="SELECT * FROM user_log where Date between '$from' and '$to'";
      $data_view=mysql_query($query_view,$connect);

.

while($row_view=mysql_fetch_array($data_view)){
    echo"
    <tr><td>".$row_view['User']."</td><td>".$row_view['Date']."</td><td>".$row_view['Time']."</td></tr>";
    }
    }

try this code

if(isset($_POST['from'])&& isset($_POST['to']))
{
     include_once('../connection.php');
     echo $from= $_POST['from'];
     echo $to=$_POST['to'];
     $query_view="SELECT * FROM user_log where `Date` between '".$from."' and '".$to."'";
     $data_view=mysql_query($query_view,$connect);

I think you want:

  echo $to=$_POST['to'];

instead of

  echo $to=$_POST['from'];